Class: RemoteLock::Adapters::Base
- Inherits:
-
Object
- Object
- RemoteLock::Adapters::Base
- Defined in:
- lib/remote_lock/adapters/base.rb
Class Method Summary collapse
Instance Method Summary collapse
- #delete(key) ⇒ Object
- #has_key?(key, options = {}) ⇒ Boolean
-
#initialize(connection) ⇒ Base
constructor
A new instance of Base.
- #store(key, options = {}) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Base
Returns a new instance of Base.
6 7 8 |
# File 'lib/remote_lock/adapters/base.rb', line 6 def initialize(connection) @connection = connection end |
Class Method Details
.valid?(adapter) ⇒ Boolean
22 23 24 25 26 |
# File 'lib/remote_lock/adapters/base.rb', line 22 def self.valid?(adapter) adapter.respond_to?(:store) && adapter.respond_to?(:has_key?) && adapter.respond_to?(:delete) end |
Instance Method Details
#delete(key) ⇒ Object
18 19 20 |
# File 'lib/remote_lock/adapters/base.rb', line 18 def delete(key) raise NotImplementedError end |
#has_key?(key, options = {}) ⇒ Boolean
14 15 16 |
# File 'lib/remote_lock/adapters/base.rb', line 14 def has_key?(key, = {}) raise NotImplementedError end |
#store(key, options = {}) ⇒ Object
10 11 12 |
# File 'lib/remote_lock/adapters/base.rb', line 10 def store(key, = {}) raise NotImplementedError end |