Class: Hexagonal::Repository
- Inherits:
-
Object
- Object
- Hexagonal::Repository
- Defined in:
- lib/hexagonal/repository.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
writeonly
Sets the attribute adapter.
-
#database_klass ⇒ Object
writeonly
Sets the attribute database_klass.
Instance Method Summary collapse
- #all ⇒ Object
- #destroy(object) ⇒ Object
- #find(id) ⇒ Object
- #save(object) ⇒ Object
- #save!(object) ⇒ Object
- #unit_of_work ⇒ Object
Instance Attribute Details
#adapter=(value) ⇒ Object
Sets the attribute adapter
3 4 5 |
# File 'lib/hexagonal/repository.rb', line 3 def adapter=(value) @adapter = value end |
#database_klass=(value) ⇒ Object (writeonly)
Sets the attribute database_klass
3 4 5 |
# File 'lib/hexagonal/repository.rb', line 3 def database_klass=(value) @database_klass = value end |
Instance Method Details
#all ⇒ Object
5 6 7 |
# File 'lib/hexagonal/repository.rb', line 5 def all adapter.all end |
#destroy(object) ⇒ Object
21 22 23 |
# File 'lib/hexagonal/repository.rb', line 21 def destroy(object) adapter.destroy(object) end |
#find(id) ⇒ Object
9 10 11 |
# File 'lib/hexagonal/repository.rb', line 9 def find(id) adapter.find id end |
#save(object) ⇒ Object
13 14 15 |
# File 'lib/hexagonal/repository.rb', line 13 def save(object) adapter.save(object) end |
#save!(object) ⇒ Object
17 18 19 |
# File 'lib/hexagonal/repository.rb', line 17 def save!(object) adapter.save!(object) end |
#unit_of_work ⇒ Object
25 26 27 |
# File 'lib/hexagonal/repository.rb', line 25 def unit_of_work adapter.unit_of_work end |