Class: Height::Units::Millimeters
- Inherits:
-
Base
- Object
- Base
- Height::Units::Millimeters
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
Instance Method Details
#to_centimeters ⇒ Object
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_feet ⇒ Object
24
25
26
|
# File 'lib/height/units/millimeters.rb', line 24
def to_feet
to_inches.to_feet
end
|
#to_inches ⇒ Object
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_meters ⇒ Object
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_millimeters ⇒ Object
5
6
7
|
# File 'lib/height/units/millimeters.rb', line 5
def to_millimeters
self
end
|