Sha256: c5176e47388de352131066a4e2ec1db76ebf4c6b6d24f72e1a37b88cac586381

Contents?: true

Size: 470 Bytes

Versions: 5

Compression:

Stored size: 470 Bytes

Contents

module Quantified
  class Mass < Attribute
    system :metric do
      primitive :gram

      one :milligram, :is => Mass.new(0.001, :grams)
      one :kilogram, :is => Mass.new(1000, :grams)
    end

    system :imperial do
      primitive :ounce
      one :ounce, :is => Mass.new(28.349523125, :grams)

      one :pound, :is => Mass.new(16, :ounces)
      one :stone, :is => Mass.new(14, :pounds)
      one :short_ton, :is => Mass.new(2000, :pounds)
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
active_shipping-0.12.6 lib/vendor/quantified/lib/quantified/mass.rb
quantified-1.0.0 lib/quantified/mass.rb
active_shipping-1.0.0.pre2 lib/vendor/quantified/lib/quantified/mass.rb
active_shipping-1.0.0.pre1 lib/vendor/quantified/lib/quantified/mass.rb
active_shipping-0.12.5 lib/vendor/quantified/lib/quantified/mass.rb