Class: PHPRB::Compiler::Buffer
Instance Attribute Summary collapse
-
#script ⇒ Object
readonly
Returns the value of attribute script.
Instance Method Summary collapse
- #close ⇒ Object
- #cr ⇒ Object
-
#initialize(compiler) ⇒ Buffer
constructor
A new instance of Buffer.
- #push(cmd) ⇒ Object
Constructor Details
#initialize(compiler) ⇒ Buffer
Returns a new instance of Buffer.
258 259 260 261 262 263 264 265 |
# File 'lib/web/phprb.rb', line 258 def initialize(compiler) @compiler = compiler @line = [] @script = "" @compiler.pre_cmd.each do |x| push(x) end end |
Instance Attribute Details
#script ⇒ Object (readonly)
Returns the value of attribute script.
266 267 268 |
# File 'lib/web/phprb.rb', line 266 def script @script end |
Instance Method Details
#close ⇒ Object
278 279 280 281 282 283 284 285 |
# File 'lib/web/phprb.rb', line 278 def close return unless @line @compiler.post_cmd.each do |x| push(x) end @script << (@line.join('; ')) @line = nil end |
#cr ⇒ Object
272 273 274 275 276 |
# File 'lib/web/phprb.rb', line 272 def cr @script << (@line.join('; ')) @line = [] @script << "\n" end |
#push(cmd) ⇒ Object
268 269 270 |
# File 'lib/web/phprb.rb', line 268 def push(cmd) @line << cmd end |