Sha256: 73d7b883c888294a8e7f884fde87e975c51727712a5449d7aa935b8df82449d1

Contents?: true

Size: 547 Bytes

Versions: 5

Compression:

Stored size: 547 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(0.0254, :metres)

      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

5 entries across 5 versions & 2 rubygems

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