Class: Cero::Adapters::AbstractAdapter

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

Direct Known Subclasses

MemoryAdapter, SqlAdapter

Instance Method Summary collapse

Constructor Details

#initialize(collection = nil) ⇒ AbstractAdapter

Returns a new instance of AbstractAdapter.



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

def initialize(collection = nil)
  @collection = {}
end

Instance Method Details

#all(collection) ⇒ Object



31
32
33
# File 'lib/cero/adapters/abstract_adapter.rb', line 31

def all(collection)
  raise Errors::AbstractMethodError
end

#clear(collection) ⇒ Object



51
52
53
# File 'lib/cero/adapters/abstract_adapter.rb', line 51

def clear(collection)
  raise Errors::AbstractMethodError
end

#count(collection) ⇒ Object



43
44
45
# File 'lib/cero/adapters/abstract_adapter.rb', line 43

def count(collection)
  raise Errors::AbstractMethodError
end

#create(collection, entity) ⇒ Object



11
12
13
# File 'lib/cero/adapters/abstract_adapter.rb', line 11

def create(collection, entity)
  raise Errors::AbstractMethodError
end

#delete(collection, entity) ⇒ Object



23
24
25
# File 'lib/cero/adapters/abstract_adapter.rb', line 23

def delete(collection, entity)
  raise Errors::AbstractMethodError
end

#find(collection, id) ⇒ Object



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

def find(collection, id)
  raise Errors::AbstractMethodError
end

#first(collection) ⇒ Object



35
36
37
# File 'lib/cero/adapters/abstract_adapter.rb', line 35

def first(collection)
  raise Errors::AbstractMethodError
end

#last(collection) ⇒ Object



39
40
41
# File 'lib/cero/adapters/abstract_adapter.rb', line 39

def last(collection)
  raise Errors::AbstractMethodError
end

#query(collection, &block) ⇒ Object



47
48
49
# File 'lib/cero/adapters/abstract_adapter.rb', line 47

def query(collection, &block)
  raise Errors::AbstractMethodError
end

#save(collection, entity) ⇒ Object



27
28
29
# File 'lib/cero/adapters/abstract_adapter.rb', line 27

def save(collection, entity)
  raise Errors::AbstractMethodError
end

#update(collection, entity) ⇒ Object



19
20
21
# File 'lib/cero/adapters/abstract_adapter.rb', line 19

def update(collection, entity)
  raise Errors::AbstractMethodError
end