Class: Height::Parsers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/height/parsers/base.rb

Direct Known Subclasses

Imperial, Metric

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ Base

Returns a new instance of Base.



6
7
8
9
# File 'lib/height/parsers/base.rb', line 6

def initialize(input)
  @input = input
  @value = self.class.parse(input)
end

Instance Attribute Details

#inputObject (readonly)

Returns the value of attribute input.



4
5
6
# File 'lib/height/parsers/base.rb', line 4

def input
  @input
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/height/parsers/base.rb', line 4

def value
  @value
end

Instance Method Details

#parsed?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/height/parsers/base.rb', line 11

def parsed?
  @value
end