Class: ActiveRecord::Query::Context
- Inherits:
-
Object
- Object
- ActiveRecord::Query::Context
- Defined in:
- lib/active_record/query/context.rb
Instance Attribute Summary collapse
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Instance Method Summary collapse
- #<<(node) ⇒ Object
- #arel ⇒ Object
-
#initialize ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize ⇒ Context
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
#nodes ⇒ Object (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 |
#arel ⇒ Object
13 14 15 |
# File 'lib/active_record/query/context.rb', line 13 def arel Arel::Nodes::Grouping.new(nodes) end |