Class: ScopeChain::AssociationChain
- Inherits:
-
Object
- Object
- ScopeChain::AssociationChain
- Defined in:
- lib/scope_chain.rb
Defined Under Namespace
Classes: MissingAssociationError
Instance Attribute Summary collapse
-
#association ⇒ Object
writeonly
Sets the attribute association.
-
#association_name ⇒ Object
Returns the value of attribute association_name.
-
#instance ⇒ Object
Returns the value of attribute instance.
Instance Method Summary collapse
- #as(association_name) ⇒ Object
-
#initialize(instance) ⇒ AssociationChain
constructor
A new instance of AssociationChain.
Constructor Details
#initialize(instance) ⇒ AssociationChain
Returns a new instance of AssociationChain.
22 23 24 |
# File 'lib/scope_chain.rb', line 22 def initialize(instance) self.instance = instance end |
Instance Attribute Details
#association=(value) ⇒ Object
Sets the attribute association
20 21 22 |
# File 'lib/scope_chain.rb', line 20 def association=(value) @association = value end |
#association_name ⇒ Object
Returns the value of attribute association_name.
20 21 22 |
# File 'lib/scope_chain.rb', line 20 def association_name @association_name end |
#instance ⇒ Object
Returns the value of attribute instance.
20 21 22 |
# File 'lib/scope_chain.rb', line 20 def instance @instance end |
Instance Method Details
#as(association_name) ⇒ Object
26 27 28 29 30 |
# File 'lib/scope_chain.rb', line 26 def as(association_name) self.association_name = association_name chain end |