Class: CERB::Buffer
- Inherits:
-
Object
- Object
- CERB::Buffer
- Defined in:
- lib/csquare/cerb.rb
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize ⇒ Buffer
constructor
A new instance of Buffer.
- #push(code) ⇒ Object
- #reset! ⇒ Object
- #result ⇒ Object
Constructor Details
#initialize ⇒ Buffer
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
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 |
#result ⇒ Object
69 70 71 |
# File 'lib/csquare/cerb.rb', line 69 def result @code.join("\n") end |