Class: Kwartz::NativeExpression
- Inherits:
-
Expression
- Object
- Node
- Expression
- Kwartz::NativeExpression
- Defined in:
- lib/kwartz/node.rb
Overview
represents expression in target language code
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#escape ⇒ Object
(also: #escape?)
Returns the value of attribute escape.
Instance Method Summary collapse
- #_inspect(indent = 0) ⇒ Object
- #accept(translator) ⇒ Object
-
#initialize(code, escape = nil) ⇒ NativeExpression
constructor
A new instance of NativeExpression.
Constructor Details
#initialize(code, escape = nil) ⇒ NativeExpression
Returns a new instance of NativeExpression.
46 47 48 49 |
# File 'lib/kwartz/node.rb', line 46 def initialize(code, escape=nil) @code = code @escape = escape unless escape == nil end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
50 51 52 |
# File 'lib/kwartz/node.rb', line 50 def code @code end |
#escape ⇒ Object Also known as: escape?
Returns the value of attribute escape.
51 52 53 |
# File 'lib/kwartz/node.rb', line 51 def escape @escape end |
Instance Method Details
#_inspect(indent = 0) ⇒ Object
56 57 58 |
# File 'lib/kwartz/node.rb', line 56 def _inspect(indent=0) return @code end |
#accept(translator) ⇒ Object
61 62 63 |
# File 'lib/kwartz/node.rb', line 61 def accept(translator) translator.translate_native_expr(self) end |