Class: ERB::Compiler::Buffer
Overview
:nodoc:
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.
490 491 492 493 494 495 496 497 |
# File 'lib/erb.rb', line 490 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.
498 499 500 |
# File 'lib/erb.rb', line 498 def script @script end |
Instance Method Details
#close ⇒ Object
510 511 512 513 514 515 516 517 |
# File 'lib/erb.rb', line 510 def close return unless @line @compiler.post_cmd.each do |x| push(x) end @script << (@line.join('; ')) @line = nil end |
#cr ⇒ Object
504 505 506 507 508 |
# File 'lib/erb.rb', line 504 def cr @script << (@line.join('; ')) @line = [] @script << "\n" end |
#push(cmd) ⇒ Object
500 501 502 |
# File 'lib/erb.rb', line 500 def push(cmd) @line << cmd end |