Class: Memoh::DB::AbstractAdapter
- Inherits:
-
Object
- Object
- Memoh::DB::AbstractAdapter
- Defined in:
- lib/memoh/db/abstract_adapter.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Method Summary collapse
- #all ⇒ Object
- #create(obj) ⇒ Object
- #delete(obj) ⇒ Object
- #find_by(attributes) ⇒ Object
- #update(obj) ⇒ Object
Instance Method Details
#all ⇒ Object
8 9 10 |
# File 'lib/memoh/db/abstract_adapter.rb', line 8 def all raise NotImplementedError end |
#create(obj) ⇒ Object
18 19 20 |
# File 'lib/memoh/db/abstract_adapter.rb', line 18 def create(obj) raise NotImplementedError end |
#delete(obj) ⇒ Object
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
22 23 24 |
# File 'lib/memoh/db/abstract_adapter.rb', line 22 def update(obj) raise NotImplementedError end |