Class: Get::Adapters::AbstractAdapter
- Inherits:
-
Object
- Object
- Get::Adapters::AbstractAdapter
- Defined in:
- lib/get/adapters/abstract_adapter.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Class Method Summary collapse
- .context_for_entity(entity) ⇒ Object
- .descendants ⇒ Object
- .entity_context_map ⇒ Object
- .expected_errors ⇒ Object
- .not_implemented_error ⇒ Object
Instance Method Summary collapse
- #ancestors(options = {}) ⇒ Object
- #eager_load(options = {}) ⇒ Object
- #find_all(options = {}) ⇒ Object
- #find_first(options = {}) ⇒ Object
- #get!(options = {}) ⇒ Object
-
#initialize(context) ⇒ AbstractAdapter
constructor
A new instance of AbstractAdapter.
- #to_hash ⇒ Object
Constructor Details
#initialize(context) ⇒ AbstractAdapter
Returns a new instance of AbstractAdapter.
32 33 34 |
# File 'lib/get/adapters/abstract_adapter.rb', line 32 def initialize(context) @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
4 5 6 |
# File 'lib/get/adapters/abstract_adapter.rb', line 4 def context @context end |
Class Method Details
.context_for_entity(entity) ⇒ Object
11 12 13 |
# File 'lib/get/adapters/abstract_adapter.rb', line 11 def context_for_entity(entity) not_implemented_error end |
.descendants ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/get/adapters/abstract_adapter.rb', line 23 def descendants descendants = [] ObjectSpace.each_object(singleton_class) do |k| descendants.unshift k unless k == self end descendants end |
.entity_context_map ⇒ Object
15 16 17 |
# File 'lib/get/adapters/abstract_adapter.rb', line 15 def entity_context_map not_implemented_error end |
.expected_errors ⇒ Object
7 8 9 |
# File 'lib/get/adapters/abstract_adapter.rb', line 7 def expected_errors not_implemented_error end |
.not_implemented_error ⇒ Object
19 20 21 |
# File 'lib/get/adapters/abstract_adapter.rb', line 19 def not_implemented_error raise ::Get::Errors::MethodNotImplemented, 'You must implement this method in your adapter.' end |
Instance Method Details
#ancestors(options = {}) ⇒ Object
48 49 50 |
# File 'lib/get/adapters/abstract_adapter.rb', line 48 def ancestors( = {}) not_implemented_error end |
#eager_load(options = {}) ⇒ Object
52 53 54 |
# File 'lib/get/adapters/abstract_adapter.rb', line 52 def eager_load( = {}) not_implemented_error end |
#find_all(options = {}) ⇒ Object
44 45 46 |
# File 'lib/get/adapters/abstract_adapter.rb', line 44 def find_all( = {}) not_implemented_error end |
#find_first(options = {}) ⇒ Object
40 41 42 |
# File 'lib/get/adapters/abstract_adapter.rb', line 40 def find_first( = {}) not_implemented_error end |
#get!(options = {}) ⇒ Object
36 37 38 |
# File 'lib/get/adapters/abstract_adapter.rb', line 36 def get!( = {}) not_implemented_error end |
#to_hash ⇒ Object
56 57 58 |
# File 'lib/get/adapters/abstract_adapter.rb', line 56 def to_hash not_implemented_error end |