Class: CustomERB::Compiler::Buffer
- Defined in:
- lib/ontomde-core/customERB.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.
504 505 506 507 508 509 510 511 |
# File 'lib/ontomde-core/customERB.rb', line 504 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.
512 513 514 |
# File 'lib/ontomde-core/customERB.rb', line 512 def script @script end |
Instance Method Details
#close ⇒ Object
524 525 526 527 528 529 530 531 |
# File 'lib/ontomde-core/customERB.rb', line 524 def close return unless @line @compiler.post_cmd.each do |x| push(x) end @script << (@line.join('; ')) @line = nil end |
#cr ⇒ Object
518 519 520 521 522 |
# File 'lib/ontomde-core/customERB.rb', line 518 def cr @script << (@line.join('; ')) @line = [] @script << "\n" end |
#push(cmd) ⇒ Object
514 515 516 |
# File 'lib/ontomde-core/customERB.rb', line 514 def push(cmd) @line << cmd end |