Class: TabularText::Builder

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

Instance Method Summary collapse

Constructor Details

#initializeBuilder

Returns a new instance of Builder.



3
4
5
# File 'lib/tabular-text/builder.rb', line 3

def initialize
  @lines = []
end

Instance Method Details

#lineObject



7
8
9
10
11
12
# File 'lib/tabular-text/builder.rb', line 7

def line
  Line.new.tap do |line|
    @lines << line
    yield line
  end
end

#renderObject



14
15
16
# File 'lib/tabular-text/builder.rb', line 14

def render
  @lines.join("\r\n")
end