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

Returns a new instance of And.



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

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.



44
45
46
# File 'lib/ransack/adapters/active_record/3.0/compat.rb', line 44

def children
  @children
end

Instance Method Details

#leftObject



53
54
55
# File 'lib/ransack/adapters/active_record/3.0/compat.rb', line 53

def left
  children.first
end

#rightObject



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

def right
  children[1]
end