Sha256: 7154bc3f92efcc7e95b895efde8d6619a214194b7302814f07dc581143ac2f32

Contents?: true

Size: 485 Bytes

Versions: 48

Compression:

Stored size: 485 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

48 entries across 48 versions & 6 rubygems

Version Path
active_shipping-0.9.1 lib/vendor/quantified/lib/quantified/mass.rb
active_shipping-0.1.4 lib/vendor/quantified/lib/quantified/mass.rb
active_shipping-0.1.3 lib/vendor/quantified/lib/quantified/mass.rb
active_shipping-0.1.2 lib/vendor/quantified/lib/quantified/mass.rb
active_shipping-0.1.1 lib/vendor/quantified/lib/quantified/mass.rb
active_shipping-0.1.0 lib/vendor/quantified/lib/quantified/mass.rb
active_shipping-0.0.2 lib/vendor/quantified/lib/quantified/mass.rb
active_shipping-0.0.1 lib/vendor/quantified/lib/quantified/mass.rb