Sha256: 60de068c4a5cbf37a7033024b6c6d0fe0adc1a2c1ace4067fabbb28d7662da5f

Contents?: true

Size: 1.29 KB

Versions: 3

Compression:

Stored size: 1.29 KB

Contents

Units.derive :volume, Units[:length]**3 do |m|
  m.system :metric do |s|
    s.unit :name => :liter, :equals => (10.cm)**3, :abbrev => :L, :greek => :ten
  end
  m.system :us do |s|
    s.unit :name => :minim, :equals => (1/480.0).floz, :abbrev => :min
    s.unit :name => :drop, :equals => (1/360.0).floz, :abbrev => :gtt
    s.unit :name => :fluid_dram, :equals => 0.125.floz, :abbrev => :fldr
    s.unit :name => :teaspoon, :equals => (1/3.0).tbsp, :abbrev => :tsp
    s.unit :name => :tablespoon, :equals => 0.5.floz, :abbrev => :tbsp
    s.unit :name => :fluid_ounce, :equals => 29.5735295625.mL, :abbrev => :floz
    s.unit :name => :cup, :equals => 8.floz, :abbrev => :c
    s.unit :name => :pint, :equals => 2.cups, :abbrev => :pt
    s.unit :name => :quart, :equals => 2.pints, :abbrev => :qt
    s.unit :name => :gallon, :equals => 4.quarts, :abbrev => :gal
    s.unit :name => :firkin, :equals => 9.gallons
    s.unit :name => :barrel, :equals => 31.5.gallons, :abbrev => :flbl
    s.unit :name => :hogshead, :equals => 2.barrels, :abbrev => :hhd
  end
  m.system :mixology do |s|
    s.unit :name => :pony, :equals => 0.75.shots
    s.unit :name => :shot, :equals => 1.floz
    s.unit :name => :jigger, :equals => 1.5.shots
    s.unit :name => :fifth, :equals => 0.2.gallons
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eymiha_units-0.1.0 lib/units/definitions/volume.rb
eymiha_units-1.0.0 lib/eymiha/units/definitions/volume.rb
eymiha_units-1.0.1 lib/eymiha/units/definitions/volume.rb