Method: RubyUnits::Unit#to_unit
- Defined in:
- lib/ruby_units/unit.rb
#to_unit(other = nil) ⇒ RubyUnits::Unit Also known as: unit
Convert the unit to a Unit, possibly performing a conversion. > The ability to pass a Unit to convert to was added in v3.0.0 for > consistency with other uses of #to_unit.
583 584 585 |
# File 'lib/ruby_units/unit.rb', line 583 def to_unit(other = nil) other ? convert_to(other) : self end |