Class: Lf::Row
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Lf::Row
- Defined in:
- lib/lf/row.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(line) ⇒ Row
constructor
A new instance of Row.
- #to_s(format = :ltsv) ⇒ Object
Constructor Details
#initialize(line) ⇒ Row
Returns a new instance of Row.
9 10 11 12 13 14 15 16 17 |
# File 'lib/lf/row.rb', line 9 def initialize(line) if line.is_a?(Hash) @raw = line else @raw = LTSV.parse(line.to_s.chomp)[0] end super(@raw) end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
7 8 9 |
# File 'lib/lf/row.rb', line 7 def raw @raw end |
Instance Method Details
#to_s(format = :ltsv) ⇒ Object
19 20 21 |
# File 'lib/lf/row.rb', line 19 def to_s(format = :ltsv) Lf::Formatter[format.to_s.to_sym].format(self) end |