Class: Kabk::Adapters::Base
- Inherits:
-
Object
- Object
- Kabk::Adapters::Base
- Defined in:
- lib/kabk/adapters/base.rb
Overview
Abstract base class for ORM Adapters
Direct Known Subclasses
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #create(attributes, context: {}) ⇒ Object
- #delete(id, context: {}) ⇒ Object
- #get(id, context: {}) ⇒ Object
-
#initialize(resource) ⇒ Base
constructor
A new instance of Base.
- #list(params, context: {}) ⇒ Object
- #update(id, attributes, context: {}) ⇒ Object
Constructor Details
#initialize(resource) ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/kabk/adapters/base.rb', line 9 def initialize(resource) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
7 8 9 |
# File 'lib/kabk/adapters/base.rb', line 7 def resource @resource end |
Instance Method Details
#create(attributes, context: {}) ⇒ Object
27 28 29 |
# File 'lib/kabk/adapters/base.rb', line 27 def create(attributes, context: {}) raise NotImplementedError, "#{self.class} must implement #create" end |
#delete(id, context: {}) ⇒ Object
40 41 42 |
# File 'lib/kabk/adapters/base.rb', line 40 def delete(id, context: {}) raise NotImplementedError, "#{self.class} must implement #delete" end |
#get(id, context: {}) ⇒ Object
21 22 23 |
# File 'lib/kabk/adapters/base.rb', line 21 def get(id, context: {}) raise NotImplementedError, "#{self.class} must implement #get" end |
#list(params, context: {}) ⇒ Object
15 16 17 |
# File 'lib/kabk/adapters/base.rb', line 15 def list(params, context: {}) raise NotImplementedError, "#{self.class} must implement #list" end |
#update(id, attributes, context: {}) ⇒ Object
34 35 36 |
# File 'lib/kabk/adapters/base.rb', line 34 def update(id, attributes, context: {}) raise NotImplementedError, "#{self.class} must implement #update" end |