Class: TM::Parse::PlainText::Row

Inherits:
Object
  • Object
show all
Defined in:
lib/tm/parse/plain_text.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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 "      def \#{header}\n        @\#{header} ||= \#{value} rescue \#{value.inspect}\n      end\n       EOF\n\n    self.values.push PlainText::Attribute.new(value, header)\n  end\nend\n"

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



49
50
51
# File 'lib/tm/parse/plain_text.rb', line 49

def headers
  @headers
end

#valuesObject

Returns the value of attribute values.



49
50
51
# File 'lib/tm/parse/plain_text.rb', line 49

def values
  @values
end