Skip to content

Cannot register unit #51

Open
Open
@pinkynrg

Description

@pinkynrg

I'm trying to register a unit called 'mma'.

Unitwise.register(
  names: "mma",
  symbol: "mma",
  primary_code: "mma",
  secondary_code: "MMA",
  scale: {
    value: 12.0,
    unit_code: 'm'
  },
  property: '...'
)

Once i do:

 Unitwise::Atom.find("mma")

I get: => #<Unitwise::Atom names=["xxx"], primary_code="mma", secondary_code="MMA", symbol="XXX", scale=#<Unitwise::Scale value=1 unit=m>, classification=nil, property="xxx", metric=false, special=false, arbitrary=false, dim="L">

but when I do this:

Unitwise(1,"mma")

I get: Unitwise::ExpressionError: Could not evaluate 'mma'.

Same thing by using the secondary_code: Unitwise::ExpressionError: Could not evaluate 'MMA'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions