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:



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

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