Class: TabularText::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/tabular-text/line.rb

Instance Method Summary collapse

Constructor Details

#initializeLine

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_sObject



11
12
13
# File 'lib/tabular-text/line.rb', line 11

def to_s
  @fields.join
end