Class: Height::Units::Millimeters

Inherits:
Base
  • Object
show all
Defined in:
lib/height/units/millimeters.rb

Instance Attribute Summary

Attributes inherited from Base

#value

Instance Method Summary collapse

Methods inherited from Base

#*, #+, #-, #/, #<=>, #initialize, round_value, #to_s, #to_unit

Constructor Details

This class inherits a constructor from Height::Units::Base

Instance Method Details

#to_centimetersObject



9
10
11
12
# File 'lib/height/units/millimeters.rb', line 9

def to_centimeters
  centimeters = value / Height::MILLIMETERS_IN_CENTIMETER.to_f
  Centimeters.new(centimeters)
end

#to_feetObject



24
25
26
# File 'lib/height/units/millimeters.rb', line 24

def to_feet
  to_inches.to_feet
end

#to_inchesObject



19
20
21
22
# File 'lib/height/units/millimeters.rb', line 19

def to_inches
  inches = value / Height::MILLIMETERS_IN_INCH.to_f
  Inches.new(inches)
end

#to_metersObject



14
15
16
17
# File 'lib/height/units/millimeters.rb', line 14

def to_meters
  meters = value / Height::MILLIMETERS_IN_METER.to_f
  Meters.new(meters)
end

#to_millimetersObject



5
6
7
# File 'lib/height/units/millimeters.rb', line 5

def to_millimeters
  self
end