Class: ActiveForce::Association::EagerLoadProjectionBuilder
- Inherits:
-
Object
- Object
- ActiveForce::Association::EagerLoadProjectionBuilder
- Defined in:
- lib/active_force/association/eager_load_projection_builder.rb
Instance Attribute Summary collapse
-
#association ⇒ Object
readonly
Returns the value of attribute association.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(association) ⇒ EagerLoadProjectionBuilder
constructor
A new instance of EagerLoadProjectionBuilder.
- #projections ⇒ Object
Constructor Details
#initialize(association) ⇒ EagerLoadProjectionBuilder
Returns a new instance of EagerLoadProjectionBuilder.
12 13 14 |
# File 'lib/active_force/association/eager_load_projection_builder.rb', line 12 def initialize(association) @association = association end |
Instance Attribute Details
#association ⇒ Object (readonly)
Returns the value of attribute association.
10 11 12 |
# File 'lib/active_force/association/eager_load_projection_builder.rb', line 10 def association @association end |
Class Method Details
.build(association) ⇒ Object
5 6 7 |
# File 'lib/active_force/association/eager_load_projection_builder.rb', line 5 def build(association) new(association).projections end |
Instance Method Details
#projections ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/active_force/association/eager_load_projection_builder.rb', line 16 def projections klass = association.class.name.split('::').last builder_class = ActiveForce::Association.const_get "#{klass}ProjectionBuilder" builder_class.new(association).projections rescue NameError raise "Don't know how to build projections for #{klass}" end |