Sha256: fcb74adb698c6a69b85a47553b2387406ec05b22e6519383b844dce92147817f

Contents?: true

Size: 372 Bytes

Versions: 2

Compression:

Stored size: 372 Bytes

Contents

class Array
  # Construct a unit from an array
  # @example [1, 'mm'].to_unit => RubyUnits::Unit("1 mm")
  # @return (see RubyUnits::Unit#initialize)
  # @param [Object] other convert to same units as passed
  def to_unit(other = nil)
    other ? RubyUnits::Unit.new(self).convert_to(other) : RubyUnits::Unit.new(self)
  end
  alias :unit :to_unit
  alias :u :to_unit
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-units-1.4.5 lib/ruby_units/array.rb
ruby-units-1.4.4 lib/ruby_units/array.rb