Sha256: c8d0170929fd8e566ade7ce19801138d805af611239166327ec97352ffd32c8d

Contents?: true

Size: 380 Bytes

Versions: 19

Compression:

Stored size: 380 Bytes

Contents

class Measured::Weight < Measured::Measurable

  conversion.set_base :g,
    aliases: [:gram, :grams]

  conversion.add :kg,
    aliases: [:kilogram, :kilograms],
    value: "1000 g"

  conversion.add :lb,
    aliases: [:lbs, :pound, :pounds],
    value: [Rational(45359237,1e8), "kg"]

  conversion.add :oz,
    aliases: [:ounce, :ounces],
    value: [Rational(1,16), "lb"]

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
measured-1.6.0 lib/measured/units/weight.rb
measured-1.5.0 lib/measured/units/weight.rb
measured-1.4.0 lib/measured/units/weight.rb
measured-1.3.1 lib/measured/units/weight.rb
measured-1.3.0 lib/measured/units/weight.rb
measured-1.2.0 lib/measured/units/weight.rb
measured-1.1.0 lib/measured/units/weight.rb
measured-1.0.0 lib/measured/units/weight.rb
measured-0.0.12 lib/measured/units/weight.rb
measured-0.0.11 lib/measured/units/weight.rb
measured-0.0.10 lib/measured/units/weight.rb
measured-0.0.9 lib/measured/units/weight.rb
measured-0.0.8 lib/measured/units/weight.rb
measured-0.0.7 lib/measured/units/weight.rb
measured-0.0.6 lib/measured/units/weight.rb
measured-0.0.4 lib/measured/units/weight.rb
measured-0.0.3 lib/measured/units/weight.rb
measured-0.0.2 lib/measured/units/weight.rb
measured-0.0.1 lib/measured/units/weight.rb