Class: Seedie::Associations::BaseAssociation
- Inherits:
-
Object
- Object
- Seedie::Associations::BaseAssociation
- Includes:
- Reporters::Reportable
- Defined in:
- lib/seedie/associations/base_association.rb
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_COUNT =
1
- INDEX =
0
Instance Attribute Summary collapse
-
#association_config ⇒ Object
readonly
Returns the value of attribute association_config.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
-
#reporters ⇒ Object
readonly
Returns the value of attribute reporters.
Instance Method Summary collapse
- #generate_association ⇒ Object
- #generate_associations ⇒ Object
-
#initialize(record, model, association_config, reporters = []) ⇒ BaseAssociation
constructor
A new instance of BaseAssociation.
Methods included from Reporters::Reportable
Constructor Details
#initialize(record, model, association_config, reporters = []) ⇒ BaseAssociation
Returns a new instance of BaseAssociation.
13 14 15 16 17 18 19 20 |
# File 'lib/seedie/associations/base_association.rb', line 13 def initialize(record, model, association_config, reporters = []) @record = record @model = model @association_config = association_config @reporters = reporters add_observers(@reporters) end |
Instance Attribute Details
#association_config ⇒ Object (readonly)
Returns the value of attribute association_config.
11 12 13 |
# File 'lib/seedie/associations/base_association.rb', line 11 def association_config @association_config end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
11 12 13 |
# File 'lib/seedie/associations/base_association.rb', line 11 def model @model end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
11 12 13 |
# File 'lib/seedie/associations/base_association.rb', line 11 def record @record end |
#reporters ⇒ Object (readonly)
Returns the value of attribute reporters.
11 12 13 |
# File 'lib/seedie/associations/base_association.rb', line 11 def reporters @reporters end |
Instance Method Details
#generate_association ⇒ Object
26 27 28 |
# File 'lib/seedie/associations/base_association.rb', line 26 def generate_association raise NotImplementedError end |
#generate_associations ⇒ Object
22 23 24 |
# File 'lib/seedie/associations/base_association.rb', line 22 def generate_associations raise NotImplementedError end |