Class: TabularText::Builder
- Inherits:
-
Object
- Object
- TabularText::Builder
- Defined in:
- lib/tabular-text/builder.rb
Instance Method Summary collapse
-
#initialize ⇒ Builder
constructor
A new instance of Builder.
- #line ⇒ Object
- #render ⇒ Object
Constructor Details
#initialize ⇒ Builder
Returns a new instance of Builder.
3 4 5 |
# File 'lib/tabular-text/builder.rb', line 3 def initialize @lines = [] end |
Instance Method Details
#line ⇒ Object
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 |
#render ⇒ Object
14 15 16 |
# File 'lib/tabular-text/builder.rb', line 14 def render @lines.join("\r\n") end |