Sha256: 446604f819c31261b2c145c01d77b592ff56b1d0703bf3154efab86b1b4d7815

Contents?: true

Size: 653 Bytes

Versions: 26

Compression:

Stored size: 653 Bytes

Contents

# frozen_string_literal: true

module Arel # :nodoc: all
  module Nodes
    class And < Arel::Nodes::NodeExpression
      attr_reader :children

      def initialize(children)
        super()
        @children = children
      end

      def left
        children.first
      end

      def right
        children[1]
      end

      def fetch_attribute(&block)
        children.any? && children.all? { |child| child.fetch_attribute(&block) }
      end

      def hash
        children.hash
      end

      def eql?(other)
        self.class == other.class &&
          self.children == other.children
      end
      alias :== :eql?
    end
  end
end

Version data entries

26 entries across 25 versions & 5 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.7/lib/arel/nodes/and.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.3.4/lib/arel/nodes/and.rb
activerecord-7.1.5.1 lib/arel/nodes/and.rb
activerecord-7.0.8.7 lib/arel/nodes/and.rb
activerecord-7.1.5 lib/arel/nodes/and.rb
activerecord-7.1.4.2 lib/arel/nodes/and.rb
activerecord-7.0.8.6 lib/arel/nodes/and.rb
activerecord-7.1.4.1 lib/arel/nodes/and.rb
activerecord-7.0.8.5 lib/arel/nodes/and.rb
activerecord-7.1.4 lib/arel/nodes/and.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.4/lib/arel/nodes/and.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.3.4/lib/arel/nodes/and.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/arel/nodes/and.rb
activerecord-7.1.3.4 lib/arel/nodes/and.rb
activerecord-7.0.8.4 lib/arel/nodes/and.rb
activerecord-7.1.3.2 lib/arel/nodes/and.rb
activerecord-7.1.3.1 lib/arel/nodes/and.rb
activerecord-7.0.8.1 lib/arel/nodes/and.rb
activerecord-7.1.3 lib/arel/nodes/and.rb
activerecord-7.1.2 lib/arel/nodes/and.rb