Class: Renshi::Statement

Inherits:
Object
  • Object
show all
Defined in:
lib/renshi/statement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#stmtObject

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