Class: TM::Parse::PlainText
- Inherits:
-
Object
- Object
- TM::Parse::PlainText
- Defined in:
- lib/tm/parse/plain_text.rb
Defined Under Namespace
Constant Summary collapse
- @@data =
{}
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #add_row(values) ⇒ Object
-
#initialize(file, name) ⇒ PlainText
constructor
A new instance of PlainText.
Constructor Details
#initialize(file, name) ⇒ PlainText
Returns a new instance of PlainText.
7 8 9 10 11 |
# File 'lib/tm/parse/plain_text.rb', line 7 def initialize(file, name) self.file, self.name = file, name @@data[file] ||= {} @@data[file][name] ||= [] end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
5 6 7 |
# File 'lib/tm/parse/plain_text.rb', line 5 def file @file end |
#headers ⇒ Object
Returns the value of attribute headers.
5 6 7 |
# File 'lib/tm/parse/plain_text.rb', line 5 def headers @headers end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/tm/parse/plain_text.rb', line 5 def name @name end |
Class Method Details
.[](file, name) ⇒ Object
13 14 15 16 |
# File 'lib/tm/parse/plain_text.rb', line 13 def self.[](file, name) parse(file) unless @@data[file] (@@data[file] && @@data[file][name]) || [] end |