Class: Height::Parsers::Metric
- Inherits:
-
Base
- Object
- Base
- Height::Parsers::Metric
show all
- Defined in:
- lib/height/parsers/metric.rb
Instance Attribute Summary
Attributes inherited from Base
#input, #value
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #parsed?
Class Method Details
.parse(input) ⇒ Object
25
26
27
28
29
30
31
32
33
|
# File 'lib/height/parsers/metric.rb', line 25
def self.parse(input)
if input.is_a? Integer
parse_integer(input)
elsif input.is_a? Float
parse_float(input)
elsif input.is_a? String
parse_string(input)
end
end
|
Instance Method Details
#centimeters ⇒ Object
9
10
11
|
# File 'lib/height/parsers/metric.rb', line 9
def centimeters
millimeters.to_centimeters
end
|
#feet ⇒ Object
21
22
23
|
# File 'lib/height/parsers/metric.rb', line 21
def feet
inches.to_feet
end
|
#inches ⇒ Object
17
18
19
|
# File 'lib/height/parsers/metric.rb', line 17
def inches
millimeters.to_inches
end
|
#meters ⇒ Object
13
14
15
|
# File 'lib/height/parsers/metric.rb', line 13
def meters
millimeters.to_meters
end
|