Class: JMESPath::Nodes::Condition Private
- Defined in:
- lib/jmespath/nodes/condition.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- 
  
    
      #initialize(test, child)  ⇒ Condition 
    
    
  
  
  
    constructor
  
  
  
  
  
  private
  
    A new instance of Condition. 
- #optimize ⇒ Object private
- #visit(value) ⇒ Object private
Methods inherited from Node
Constructor Details
#initialize(test, child) ⇒ Condition
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Condition.
| 5 6 7 8 | # File 'lib/jmespath/nodes/condition.rb', line 5 def initialize(test, child) @test = test @child = child end | 
Instance Method Details
#optimize ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
| 18 19 20 21 22 23 24 25 | # File 'lib/jmespath/nodes/condition.rb', line 18 def optimize test = @test.optimize if (new_type = ComparatorCondition::COMPARATOR_TO_CONDITION[@test.class]) new_type.new(test.left, test.right, @child).optimize else self.class.new(test, @child.optimize) end end | 
#visit(value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
| 10 11 12 13 14 15 16 | # File 'lib/jmespath/nodes/condition.rb', line 10 def visit(value) if @test.visit(value) @child.visit(value) else nil end end |