Class: Height::Parsers::Imperial

Inherits:
Base
  • Object
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?

Constructor Details

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

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

#centimetersObject



17
18
19
# File 'lib/height/parsers/imperial.rb', line 17

def centimeters
  inches.to_centimeters
end

#feetObject



9
10
11
# File 'lib/height/parsers/imperial.rb', line 9

def feet
  inches.to_feet
end

#inchesObject



5
6
7
# File 'lib/height/parsers/imperial.rb', line 5

def inches
  Height::Units::Inches.new(value)
end

#metersObject



21
22
23
# File 'lib/height/parsers/imperial.rb', line 21

def meters
  inches.to_meters
end

#millimetersObject



13
14
15
# File 'lib/height/parsers/imperial.rb', line 13

def millimeters
  inches.to_millimeters
end