Class: Memoh::DB::AbstractAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/memoh/db/abstract_adapter.rb

Overview

:nodoc:

Direct Known Subclasses

JSONAdapter

Instance Method Summary collapse

Instance Method Details

#allObject

Raises:

  • (NotImplementedError)


8
9
10
# File 'lib/memoh/db/abstract_adapter.rb', line 8

def all
  raise NotImplementedError
end

#create(obj) ⇒ Object

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/memoh/db/abstract_adapter.rb', line 18

def create(obj)
  raise NotImplementedError
end

#delete(obj) ⇒ Object

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/memoh/db/abstract_adapter.rb', line 26

def delete(obj)
  raise NotImplementedError
end

#find_by(attributes) ⇒ Object



12
13
14
15
16
# File 'lib/memoh/db/abstract_adapter.rb', line 12

def find_by(attributes)
  all.find do |obj|
    attributes.all? { |key, value| obj.send(key) == value }
  end
end

#update(obj) ⇒ Object

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/memoh/db/abstract_adapter.rb', line 22

def update(obj)
  raise NotImplementedError
end