Module: RubyUnits::Array
- Included in:
- Array
- Defined in:
- lib/ruby_units/array.rb
Overview
Extra methods for [::Array] to support conversion to [RubyUnits::Unit]
Instance Method Summary collapse
-
#to_unit(other = nil) ⇒ RubyUnits::Unit
Construct a unit from an array.
Instance Method Details
#to_unit(other = nil) ⇒ RubyUnits::Unit
Construct a unit from an array
11 12 13 |
# File 'lib/ruby_units/array.rb', line 11 def to_unit(other = nil) other ? RubyUnits::Unit.new(self).convert_to(other) : RubyUnits::Unit.new(self) end |