Class: TM::Parse::PlainText::Row
- Inherits:
-
Object
- Object
- TM::Parse::PlainText::Row
- Defined in:
- lib/tm/parse/plain_text.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#values ⇒ Object
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(values, headers) ⇒ Row
constructor
A new instance of Row.
Constructor Details
#initialize(values, headers) ⇒ Row
Returns a new instance of Row.
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/tm/parse/plain_text.rb', line 51 def initialize(values, headers) self.values, self.headers = [], headers [values, headers].transpose.map do |value, header| self.instance_eval <<-EOF def #{header} @#{header} ||= #{value} rescue #{value.inspect} end EOF self.values.push PlainText::Attribute.new(value, header) end end |
Instance Attribute Details
#headers ⇒ Object
Returns the value of attribute headers.
49 50 51 |
# File 'lib/tm/parse/plain_text.rb', line 49 def headers @headers end |
#values ⇒ Object
Returns the value of attribute values.
49 50 51 |
# File 'lib/tm/parse/plain_text.rb', line 49 def values @values end |