Class: CERB::Buffer

Inherits:
Object
  • Object
show all
Defined in:
lib/csquare/cerb.rb

Instance Method Summary collapse

Constructor Details

#initializeBuffer

Returns a new instance of Buffer.



61
62
63
# File 'lib/csquare/cerb.rb', line 61

def initialize
  @code = []
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


77
78
79
# File 'lib/csquare/cerb.rb', line 77

def empty?
  @code.size == 0
end

#push(code) ⇒ Object



65
66
67
# File 'lib/csquare/cerb.rb', line 65

def push code
  @code << code
end

#reset!Object



73
74
75
# File 'lib/csquare/cerb.rb', line 73

def reset!
  @code = []
end

#resultObject



69
70
71
# File 'lib/csquare/cerb.rb', line 69

def result
  @code.join("\n")
end