aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/nodes/and.rb
blob: b087a10930bff1ad051a63f61733f54c85d16eea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Arel
  module Nodes
    class And < Arel::Nodes::Binary
      attr_reader :children

      def initialize children, right = nil
        unless Array === children
          warn "(#{caller.first}) AND nodes should be created with a list"
          children = [children, right]
        end
        @children = children
      end

      def left
        children.first
      end

      def right
        children[1]
      end
    end
  end
end