Class: Mkxms::Mssql::IndentedStringBuilder::LineAccumulator

Inherits:
Object
  • Object
show all
Defined in:
lib/mkxms/mssql/indented_string_builder.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


22
23
24
# File 'lib/mkxms/mssql/indented_string_builder.rb', line 22

def any_acculumation?
  @value != @indent
end

#flushObject



17
18
19
20
# File 'lib/mkxms/mssql/indented_string_builder.rb', line 17

def flush
  @flush_to[@value]
  @value = @indent.dup
end