Method: UOM::UnitFactory#create

Defined in:
lib/uom/unit_factory.rb

#create(label) ⇒ Object

Returns the unit with the given label. Creates a new unit if necessary.

Raises MeasurementError if the unit could not be created.



14
15
16
# File 'lib/uom/unit_factory.rb', line 14

def create(label)
  create_atomic(label.to_s) or create_composite(label.to_s) or raise MeasurementError.new("Unit '#{label}' not found")
end