Sha256: 75072e1e6561d02ab6d7fe1e26226cb463ceb9e28e3c2daecf9e20cc93d2d60b

Contents?: true

Size: 333 Bytes

Versions: 9

Compression:

Stored size: 333 Bytes

Contents

class Array
  # Construct a unit from an array
  # @example [1, 'mm'].to_unit => RubyUnits::Unit.new("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
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ruby-units-2.4.1 lib/ruby_units/array.rb
ruby-units-2.3.2 lib/ruby_units/array.rb
ruby-units-2.3.1 lib/ruby_units/array.rb
ruby-units-2.3.0 lib/ruby_units/array.rb
ruby-units-2.2.1 lib/ruby_units/array.rb
ruby-units-2.2.0 lib/ruby_units/array.rb
ruby-units-2.1.0 lib/ruby_units/array.rb
ruby-units-2.0.1 lib/ruby_units/array.rb
ruby-units-2.0.0 lib/ruby_units/array.rb