Method: ConfCtl::LineBuffer#flush

Defined in:
lib/confctl/line_buffer.rb

#flushString

Return the buffer’s contents and flush it

If block was given to ConfCtl::LineBuffer, it will be invoked with the buffer contents.

Returns:

  • (String)


42
43
44
45
46
47
# File 'lib/confctl/line_buffer.rb', line 42

def flush
  ret = buffer.clone
  buffer.clear
  block.call(ret) if block
  ret
end