Class: Get::Adapters::AbstractAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/get/adapters/abstract_adapter.rb

Direct Known Subclasses

ActiveRecord

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#contextObject (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

.descendantsObject



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_mapObject



15
16
17
# File 'lib/get/adapters/abstract_adapter.rb', line 15

def entity_context_map
  not_implemented_error
end

.expected_errorsObject



7
8
9
# File 'lib/get/adapters/abstract_adapter.rb', line 7

def expected_errors
  not_implemented_error
end

.not_implemented_errorObject



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(options = {})
  not_implemented_error
end

#eager_load(options = {}) ⇒ Object



52
53
54
# File 'lib/get/adapters/abstract_adapter.rb', line 52

def eager_load(options = {})
  not_implemented_error
end

#find_all(options = {}) ⇒ Object



44
45
46
# File 'lib/get/adapters/abstract_adapter.rb', line 44

def find_all(options = {})
  not_implemented_error
end

#find_first(options = {}) ⇒ Object



40
41
42
# File 'lib/get/adapters/abstract_adapter.rb', line 40

def find_first(options = {})
  not_implemented_error
end

#get!(options = {}) ⇒ Object



36
37
38
# File 'lib/get/adapters/abstract_adapter.rb', line 36

def get!(options = {})
  not_implemented_error
end

#to_hashObject



56
57
58
# File 'lib/get/adapters/abstract_adapter.rb', line 56

def to_hash
  not_implemented_error
end