Class: TabularText::Line
- Inherits:
-
Object
- Object
- TabularText::Line
- Defined in:
- lib/tabular-text/line.rb
Instance Method Summary collapse
- #field(content, length = nil) ⇒ Object
-
#initialize ⇒ Line
constructor
A new instance of Line.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Line
Returns a new instance of Line.
3 4 5 |
# File 'lib/tabular-text/line.rb', line 3 def initialize @fields = [] end |
Instance Method Details
#field(content, length = nil) ⇒ Object
7 8 9 |
# File 'lib/tabular-text/line.rb', line 7 def field(content, length = nil) @fields << Field.new(content, length) end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/tabular-text/line.rb', line 11 def to_s @fields.join end |