Class: Height::Parsers::Imperial
- Inherits:
-
Base
- Object
- Base
- Height::Parsers::Imperial
show all
- Defined in:
- lib/height/parsers/imperial.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
|
# File 'lib/height/parsers/imperial.rb', line 25
def self.parse(input)
parse_string(input) if input.is_a? String
end
|
Instance Method Details
#centimeters ⇒ Object
17
18
19
|
# File 'lib/height/parsers/imperial.rb', line 17
def centimeters
inches.to_centimeters
end
|
#feet ⇒ Object
9
10
11
|
# File 'lib/height/parsers/imperial.rb', line 9
def feet
inches.to_feet
end
|
#inches ⇒ Object
5
6
7
|
# File 'lib/height/parsers/imperial.rb', line 5
def inches
Height::Units::Inches.new(value)
end
|
#meters ⇒ Object
21
22
23
|
# File 'lib/height/parsers/imperial.rb', line 21
def meters
inches.to_meters
end
|
#millimeters ⇒ Object
13
14
15
|
# File 'lib/height/parsers/imperial.rb', line 13
def millimeters
inches.to_millimeters
end
|