Class: ERB::Compiler::Buffer
- Inherits:
-
Object
- Object
- ERB::Compiler::Buffer
- Defined in:
- lib/erb.rb
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.
456 457 458 459 460 461 462 463 |
# File 'lib/erb.rb', line 456 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
464 465 466 |
# File 'lib/erb.rb', line 464 def script @script end |
Instance Method Details
#close ⇒ Object
476 477 478 479 480 481 482 483 |
# File 'lib/erb.rb', line 476 def close return unless @line @compiler.post_cmd.each do |x| push(x) end @script << (@line.join('; ')) @line = nil end |
#cr ⇒ Object
470 471 472 473 474 |
# File 'lib/erb.rb', line 470 def cr @script << (@line.join('; ')) @line = [] @script << "\n" end |
#push(cmd) ⇒ Object
466 467 468 |
# File 'lib/erb.rb', line 466 def push(cmd) @line << cmd end |