Class: JMESPath::Nodes::And Private
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(left, right) ⇒ And
constructor
private
A new instance of And.
- #optimize ⇒ Object private
- #visit(value) ⇒ Object private
Methods inherited from Node
Constructor Details
#initialize(left, right) ⇒ And
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 And.
5 6 7 8 |
# File 'lib/jmespath/nodes/and.rb', line 5 def initialize(left, right) @left = left @right = right 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.
19 20 21 |
# File 'lib/jmespath/nodes/and.rb', line 19 def optimize self.class.new(@left.optimize, @right.optimize) 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 17 |
# File 'lib/jmespath/nodes/and.rb', line 10 def visit(value) result = @left.visit(value) if JMESPath::Util.falsey?(result) result else @right.visit(value) end end |