Class: Pragma::Decorator::Association::Adapter::Base Abstract Private
- Inherits:
-
Object
- Object
- Pragma::Decorator::Association::Adapter::Base
- Defined in:
- lib/pragma/decorator/association/adapter/base.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Subclass and override Base.supports?, #primary_key and #full_object to create a new adapter
The base association adapter, defining the interface for the implementations.
Direct Known Subclasses
Instance Attribute Summary collapse
- #bond ⇒ Object readonly private
Class Method Summary collapse
-
.supports?(_model) ⇒ Boolean
abstract
private
Returns whether the adapter supports the given model.
Instance Method Summary collapse
-
#full_object ⇒ Object
abstract
private
Returns the full object of the association represented by the provided bond.
-
#initialize(bond) ⇒ Base
constructor
private
Initializes the adapter.
-
#primary_key ⇒ String|Integer
abstract
private
Returns the primary key of the association represented by the provided bond.
Constructor Details
#initialize(bond) ⇒ Base
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes the adapter.
34 35 36 |
# File 'lib/pragma/decorator/association/adapter/base.rb', line 34 def initialize(bond) @bond = bond end |
Instance Attribute Details
#bond ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'lib/pragma/decorator/association/adapter/base.rb', line 29 def bond @bond end |
Class Method Details
.supports?(_model) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns whether the adapter supports the given model.
22 23 24 |
# File 'lib/pragma/decorator/association/adapter/base.rb', line 22 def supports?(_model) fail NotImplementedError end |
Instance Method Details
#full_object ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the full object of the association represented by the provided bond.
52 53 54 |
# File 'lib/pragma/decorator/association/adapter/base.rb', line 52 def full_object fail NotImplementedError end |
#primary_key ⇒ String|Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the primary key of the association represented by the provided bond.
43 44 45 |
# File 'lib/pragma/decorator/association/adapter/base.rb', line 43 def primary_key fail NotImplementedError end |