class Arel::Nodes::Or
For some reason, Arel’s And is properly defined as variadic (it stores @children, and hashes it all). However Arel’s Or
is defined as binary, with only @left and @right, and hashing only @left and @right.
So reimplement its ctor and accessors.
Attributes
children[R]
Public Class Methods
new(*children)
click to toggle source
Calls superclass method
# File lib/arel_extensions/boolean_functions.rb, line 50 def self.new *children children = children.flatten.map { |c| c.is_a?(self) ? c.children : c }.flatten super(*children) end
new(*children)
click to toggle source
# File lib/arel_extensions/boolean_functions.rb, line 58 def initialize *children @children = children end
Public Instance Methods
eql?(other)
click to toggle source
# File lib/arel_extensions/boolean_functions.rb, line 79 def eql?(other) self.class == other.class && children == other.children end
Also aliased as: ==
hash()
click to toggle source
# File lib/arel_extensions/boolean_functions.rb, line 75 def hash children.hash end
initialize_copy(other)
click to toggle source
Calls superclass method
# File lib/arel_extensions/boolean_functions.rb, line 62 def initialize_copy(other) super @children = other.children.copy if other.children end
left()
click to toggle source
# File lib/arel_extensions/boolean_functions.rb, line 67 def left children.first end
right()
click to toggle source
# File lib/arel_extensions/boolean_functions.rb, line 71 def right children[1] end