Sha256: 24521adef822645cf84ce376e2cccb90105ec2d58673736456495d6bcb9b8bc6

Contents?: true

Size: 566 Bytes

Versions: 48

Compression:

Stored size: 566 Bytes

Contents

module Quantified
  class Length < Attribute
    system :metric do
      primitive :metre
      
      one :centimetre, :is => Length.new(0.01, :metres)
      one :millimetre, :is => Length.new(0.1, :centimetres)
      one :kilometre, :is => Length.new(1000, :metres)
    end
    
    system :imperial do
      primitive :inch
      one :inch, :is => Length.new(2.540, :centimetres)
      
      one :foot, :plural => :feet, :is => Length.new(12, :inches)
      one :yard, :is => Length.new(3, :feet)
      one :mile, :is => Length.new(5280, :feet)
    end
  end
end

Version data entries

48 entries across 48 versions & 6 rubygems

Version Path
omniship-0.3.2.2 lib/vendor/quantified/lib/quantified/length.rb
omniship-0.1.0 lib/vendor/quantified/lib/quantified/length.rb
kschadeck-active_shipping-0.9.15 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.14 lib/vendor/quantified/lib/quantified/length.rb
rclements_active_shipping-0.9.15 lib/vendor/quantified/lib/quantified/length.rb
rclements_active_shipping-0.9.14 lib/vendor/quantified/lib/quantified/length.rb
rclements_active_shipping-0.9.13 lib/vendor/quantified/lib/quantified/length.rb
benhutton-active_shipping-0.9.13 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.13 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.12 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.11 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.10 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.9 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.8 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.7 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.6 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.5 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.4 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.3 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.2 lib/vendor/quantified/lib/quantified/length.rb