Class: Renshi::Statement
- Inherits:
-
Object
- Object
- Renshi::Statement
- Defined in:
- lib/renshi/statement.rb
Instance Attribute Summary collapse
-
#stmt ⇒ Object
Returns the value of attribute stmt.
Instance Method Summary collapse
- #compile_to_expression! ⇒ Object
- #compile_to_print! ⇒ Object
-
#initialize(str) ⇒ Statement
constructor
A new instance of Statement.
Constructor Details
#initialize(str) ⇒ Statement
Returns a new instance of Statement.
5 6 7 |
# File 'lib/renshi/statement.rb', line 5 def initialize(str) @stmt = str end |
Instance Attribute Details
#stmt ⇒ Object
Returns the value of attribute stmt.
3 4 5 |
# File 'lib/renshi/statement.rb', line 3 def stmt @stmt end |
Instance Method Details
#compile_to_expression! ⇒ Object
9 10 11 |
# File 'lib/renshi/statement.rb', line 9 def compile_to_expression! str = "#{Renshi::Parser::STRING_END}#{self.stmt};#{Renshi::Parser::STRING_START}" end |
#compile_to_print! ⇒ Object
13 14 15 |
# File 'lib/renshi/statement.rb', line 13 def compile_to_print! str = "#{Renshi::Parser::STRING_END}@output_buffer.concat((#{self.stmt}).to_s);#{Renshi::Parser::STRING_START}" end |