Class: ActiveRecord::Query::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/query/context.rb

Direct Known Subclasses

And, Or

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeContext

Returns a new instance of Context.



5
6
7
# File 'lib/active_record/query/context.rb', line 5

def initialize
  @nodes = []
end

Instance Attribute Details

#nodesObject (readonly)

Returns the value of attribute nodes.



3
4
5
# File 'lib/active_record/query/context.rb', line 3

def nodes
  @nodes
end

Instance Method Details

#<<(node) ⇒ Object



9
10
11
# File 'lib/active_record/query/context.rb', line 9

def <<(node)
  @nodes << node
end

#arelObject



13
14
15
# File 'lib/active_record/query/context.rb', line 13

def arel
  Arel::Nodes::Grouping.new(nodes)
end