Class: Arel::Nodes::And
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(children, right = nil) ⇒ And
constructor
A new instance of And.
- #left ⇒ Object
- #right ⇒ Object
Methods inherited from Node
#_caller, #and, #each, #not, #or, #to_sql
Methods included from FactoryMethods
#create_and, #create_false, #create_join, #create_on, #create_string_join, #create_table_alias, #create_true, #grouping, #lower
Constructor Details
#initialize(children, right = nil) ⇒ And
Returns a new instance of And.
6 7 8 9 10 11 12 13 |
# File 'lib/arel/nodes/and.rb', line 6 def initialize children, right = nil super() unless Array === children warn "(#{caller.first}) AND nodes should be created with a list" children = [children, right] end @children = children end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
4 5 6 |
# File 'lib/arel/nodes/and.rb', line 4 def children @children end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
27 28 29 30 |
# File 'lib/arel/nodes/and.rb', line 27 def eql? other self.class == other.class && self.children == other.children end |
#hash ⇒ Object
23 24 25 |
# File 'lib/arel/nodes/and.rb', line 23 def hash children.hash end |
#left ⇒ Object
15 16 17 |
# File 'lib/arel/nodes/and.rb', line 15 def left children.first end |
#right ⇒ Object
19 20 21 |
# File 'lib/arel/nodes/and.rb', line 19 def right children[1] end |