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.4.7 lib/vendor/quantified/lib/quantified/length.rb
omniship-0.4.6 lib/vendor/quantified/lib/quantified/length.rb
omniship-0.4.5 lib/vendor/quantified/lib/quantified/length.rb
omniship-0.4.1 lib/vendor/quantified/lib/quantified/length.rb
bcarpenter-active_shipping-0.0.2 lib/vendor/quantified/lib/quantified/length.rb
bcarpenter-active_shipping-0.0.5 lib/vendor/quantified/lib/quantified/length.rb
bcarpenter-active_shipping-0.0.6 lib/vendor/quantified/lib/quantified/length.rb
bcarpenter-active_shipping-0.0.7 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.12.4 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.12.3 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.12.2 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.12.1 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.12.0 lib/vendor/quantified/lib/quantified/length.rb
omniship-0.4.0 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.11.2 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.11.1 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.11.0 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.10.1 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.10.0 lib/vendor/quantified/lib/quantified/length.rb
active_shipping-0.9.15 lib/vendor/quantified/lib/quantified/length.rb