Class: Arel::Nodes::And

Inherits:
Node
  • Object
show all
Defined in:
lib/ransack/adapters/active_record/3.0/compat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#not

Constructor Details

#initialize(children, right = nil) ⇒ And


49
50
51
52
53
54
# File 'lib/ransack/adapters/active_record/3.0/compat.rb', line 49

def initialize children, right = nil
  unless Array === children
    children = [children, right]
  end
  @children = children
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children


47
48
49
# File 'lib/ransack/adapters/active_record/3.0/compat.rb', line 47

def children
  @children
end

Instance Method Details

#leftObject


56
57
58
# File 'lib/ransack/adapters/active_record/3.0/compat.rb', line 56

def left
  children.first
end

#rightObject


60
61
62
# File 'lib/ransack/adapters/active_record/3.0/compat.rb', line 60

def right
  children[1]
end