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.
99 100 101 102 103 104 105 106 |
# File 'lib/web/phprb.rb', line 99 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.
107 108 109 |
# File 'lib/web/phprb.rb', line 107 def script @script end |
Instance Method Details
#close ⇒ Object
119 120 121 122 123 124 125 126 |
# File 'lib/web/phprb.rb', line 119 def close return unless @line @compiler.post_cmd.each do |x| push(x) end @script << (@line.join('; ')) @line = nil end |
#cr ⇒ Object
113 114 115 116 117 |
# File 'lib/web/phprb.rb', line 113 def cr @script << (@line.join('; ')) @line = [] @script << "\n" end |
#push(cmd) ⇒ Object
109 110 111 |
# File 'lib/web/phprb.rb', line 109 def push(cmd) @line << cmd end |