class D3C3Rails::Holder

Content container

Attributes

context[RW]

@return [Context] current context

Public Class Methods

new(args={}) click to toggle source

Create new instance

@param args [Hash] @option args [Context] :context

# File lib/d3c3-rails/holder.rb, line 16
def initialize(args={})
  @context = args[:context]
  @buffer = ''
end

Public Instance Methods

<<(string) click to toggle source

Add string to buffer

@param string [String] @return [self]

# File lib/d3c3-rails/holder.rb, line 25
def << (string)
  @buffer << string.to_s
  self
end
grapher_flush() click to toggle source

Clear current buffer and return content

@return [String]

# File lib/d3c3-rails/holder.rb, line 33
def grapher_flush
  buf = @buffer.dup
  @buffer = ''
  buf
end