Method: UnitMeasurements::UnitGroupBuilder#system
- Defined in:
- lib/unit_measurements/unit_group_builder.rb
#system(system_name, &block) ⇒ Object
Defines the unit system within the unit group and evaluates the provided block in the context of the builder.
This method is used to group multiple units within the certain unit system, viz., metric, imperial, etc.
106 107 108 109 110 111 |
# File 'lib/unit_measurements/unit_group_builder.rb', line 106 def system(system_name, &block) @system = system_name instance_eval(&block) if block_given? ensure @system = nil end |