Class: Array

Inherits:
Object show all
Defined in:
lib/ruby_units/array.rb

Overview

make a unit from an array [1, ‘mm’].unit => 1 mm

Instance Method Summary collapse

Instance Method Details

#to_unit(other = nil) ⇒ Object Also known as: unit, u



4
5
6
# File 'lib/ruby_units/array.rb', line 4

def to_unit(other = nil)
  other ? Unit.new(self).to(other) : Unit.new(self)
end