Top Level Namespace

Defined Under Namespace

Modules: Unitwise

Instance Method Summary collapse

Instance Method Details

#Unitwise(*args) ⇒ Unitwise::Measurement

Measurement initializer shorthand. Use this to instantiate new measurements.

Examples:

Unitwise(20, 'mile') # => #<Unitwise::Measurement 20 mile>
Unitwise('km') # => #<Unitwise::Measurement 1 km>

Parameters:

  • first (Numeric, String)

    Either a numeric value or a unit expression

  • last (String, Nil)

    Either a unit expression, or nil

Returns:



81
82
83
# File 'lib/unitwise.rb', line 81

def Unitwise(*args)
  Unitwise::Measurement.new(*args)
end