Class: TPPlus::Nodes::IndirectNode
- Defined in:
- lib/tp_plus/nodes/indirect_node.rb
Instance Method Summary collapse
- #eval(context, options = {}) ⇒ Object
-
#initialize(type, target) ⇒ IndirectNode
constructor
A new instance of IndirectNode.
- #requires_mixed_logic?(context) ⇒ Boolean
Methods inherited from BaseNode
Constructor Details
#initialize(type, target) ⇒ IndirectNode
Returns a new instance of IndirectNode.
4 5 6 7 |
# File 'lib/tp_plus/nodes/indirect_node.rb', line 4 def initialize(type, target) @type = type @target = target end |
Instance Method Details
#eval(context, options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/tp_plus/nodes/indirect_node.rb', line 15 def eval(context,={}) s = "#{@type.upcase}[#{@target.eval(context)}]" if [:opposite] s = "!#{s}" end if [:as_condition] s = "(#{s})" end s end |
#requires_mixed_logic?(context) ⇒ Boolean
9 10 11 12 13 |
# File 'lib/tp_plus/nodes/indirect_node.rb', line 9 def requires_mixed_logic?(context) return true if @type == :f false end |