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, enc = nil) ⇒ Buffer
constructor
A new instance of Buffer.
- #push(cmd) ⇒ Object
Constructor Details
#initialize(compiler, enc = nil) ⇒ Buffer
Returns a new instance of Buffer.
509 510 511 512 513 514 515 516 |
# File 'lib/framework/erb.rb', line 509 def initialize(compiler, enc=nil) @compiler = compiler @line = [] @script = enc ? "#coding:#{enc.to_s}\n" : "" @compiler.pre_cmd.each do |x| push(x) end end |
Instance Attribute Details
#script ⇒ Object (readonly)
Returns the value of attribute script.
517 518 519 |
# File 'lib/framework/erb.rb', line 517 def script @script end |
Instance Method Details
#close ⇒ Object
529 530 531 532 533 534 535 536 |
# File 'lib/framework/erb.rb', line 529 def close return unless @line @compiler.post_cmd.each do |x| push(x) end @script << (@line.join('; ')) @line = nil end |
#cr ⇒ Object
523 524 525 526 527 |
# File 'lib/framework/erb.rb', line 523 def cr @script << (@line.join('; ')) @line = [] @script << "\n" end |
#push(cmd) ⇒ Object
519 520 521 |
# File 'lib/framework/erb.rb', line 519 def push(cmd) @line << cmd end |