Class: Mongoid::Association::EagerLoad::AssociationInclusion Private
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
|
|
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Inclusion
|
|
|
Instance Chain:
self,
Inclusion
|
|
| Inherits: |
Mongoid::Association::EagerLoad::Inclusion
|
| Defined in: | lib/mongoid/association/eager_load/inclusion.rb |
Overview
An inclusion that stands for a single association. The LookupPipeline holds the stage-building helpers the kinds lean on, and a node carries its own children, so the pipeline is built by recursion from the roots downward.
Class Method Summary
-
.for(association, pipeline, children) ⇒ AssociationInclusion
Internal use only
Builds the right kind of inclusion for the association.
-
.for?(association) ⇒ true | false
Internal use only
Whether this kind handles the given association.
- .new(association, pipeline, children) ⇒ AssociationInclusion constructor Internal use only
Instance Attribute Summary
- #association ⇒ Mongoid::Association::Relatable readonly Internal use only
Instance Method Summary
Inclusion - Inherited
| #contribute | Add this inclusion's stages to the destination. |
Constructor Details
.new(association, pipeline, children) ⇒ AssociationInclusion
# File 'lib/mongoid/association/eager_load/inclusion.rb', line 57
def initialize(association, pipeline, children) super() @association = association @pipeline = pipeline @children = children end
Class Method Details
.for(association, pipeline, children) ⇒ AssociationInclusion
Builds the right kind of inclusion for the association. Each subclass decides whether it handles it (.for?); exactly one does.
# File 'lib/mongoid/association/eager_load/inclusion.rb', line 40
def for(association, pipeline, children) subclasses.find { |kind| kind.for?(association) }.new(association, pipeline, children) end
.for?(association) ⇒ true | false
Whether this kind handles the given association.
# File 'lib/mongoid/association/eager_load/inclusion.rb', line 49
def for?(association) raise NotImplementedError end
Instance Attribute Details
#association ⇒ Mongoid::Association::Relatable (readonly)
# File 'lib/mongoid/association/eager_load/inclusion.rb', line 55
attr_reader :association