Sha256: e53a9e863e8aac0b2eaeb50f50a090be30ebd6d7c9824b81e9784c17ac0b8e18

Contents?: true

Size: 430 Bytes

Versions: 14

Compression:

Stored size: 430 Bytes

Contents

module JMESPath
  module Nodes
    class And < Node

      def initialize(left, right)
        @left = left
        @right = right
      end

      def visit(value)
        result = @left.visit(value)
        if JMESPath::Util.falsey?(result)
          result
        else
          @right.visit(value)
        end
      end

      def optimize
        self.class.new(@left.optimize, @right.optimize)
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
jmespath-1.6.1 lib/jmespath/nodes/and.rb
jmespath-1.6.0 lib/jmespath/nodes/and.rb
jmespath-1.5.0 lib/jmespath/nodes/and.rb
jmespath-1.4.0 lib/jmespath/nodes/and.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/jmespath-1.3.1/lib/jmespath/nodes/and.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/jmespath-1.3.1/lib/jmespath/nodes/and.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/jmespath-1.3.1/lib/jmespath/nodes/and.rb
jmespath-1.3.1 lib/jmespath/nodes/and.rb
jmespath-1.3.0 lib/jmespath/nodes/and.rb
jmespath-1.2.4 lib/jmespath/nodes/and.rb
jmespath-1.2.3 lib/jmespath/nodes/and.rb
jmespath-1.2.2 lib/jmespath/nodes/and.rb
jmespath-1.2.1 lib/jmespath/nodes/and.rb
jmespath-1.2 lib/jmespath/nodes/and.rb