Class: Mkxms::Mssql::IndentedStringBuilder::LineAccumulator
- Inherits:
-
Object
- Object
- Mkxms::Mssql::IndentedStringBuilder::LineAccumulator
- Defined in:
- lib/mkxms/mssql/indented_string_builder.rb
Instance Method Summary collapse
- #<<(v) ⇒ Object
- #any_acculumation? ⇒ Boolean
- #flush ⇒ Object
-
#initialize(indent, &flush_to) ⇒ LineAccumulator
constructor
A new instance of LineAccumulator.
Constructor Details
#initialize(indent, &flush_to) ⇒ LineAccumulator
Returns a new instance of LineAccumulator.
11 12 13 14 15 |
# File 'lib/mkxms/mssql/indented_string_builder.rb', line 11 def initialize(indent, &flush_to) @indent = indent @flush_to = flush_to @value = @indent.dup end |
Instance Method Details
#<<(v) ⇒ Object
26 27 28 29 |
# File 'lib/mkxms/mssql/indented_string_builder.rb', line 26 def <<(v) @value << v return self end |
#any_acculumation? ⇒ Boolean
22 23 24 |
# File 'lib/mkxms/mssql/indented_string_builder.rb', line 22 def any_acculumation? @value != @indent end |
#flush ⇒ Object
17 18 19 20 |
# File 'lib/mkxms/mssql/indented_string_builder.rb', line 17 def flush @flush_to[@value] @value = @indent.dup end |