Class: Kwartz::PrintStatement
- Defined in:
- lib/kwartz/node.rb
Overview
represents print statement for String and NativeExpression
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Instance Method Summary collapse
- #_inspect(indent = 0) ⇒ Object
- #accept(translator) ⇒ Object
-
#initialize(args) ⇒ PrintStatement
constructor
A new instance of PrintStatement.
Constructor Details
#initialize(args) ⇒ PrintStatement
Returns a new instance of PrintStatement.
179 180 181 |
# File 'lib/kwartz/node.rb', line 179 def initialize(args) @args = args # array end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
182 183 184 |
# File 'lib/kwartz/node.rb', line 182 def args @args end |
Instance Method Details
#_inspect(indent = 0) ⇒ Object
185 186 187 188 189 190 |
# File 'lib/kwartz/node.rb', line 185 def _inspect(indent=0) list = @args.collect { |arg| arg.is_a?(NativeExpression) ? "<%=#{arg.code}%>" : arg.inspect } return "print(" + list.join(', ') + ")\n" end |
#accept(translator) ⇒ Object
193 194 195 |
# File 'lib/kwartz/node.rb', line 193 def accept(translator) translator.translate_print_stmt(self) end |