Class: LockManager::Connection
- Inherits:
-
Object
- Object
- LockManager::Connection
- Defined in:
- lib/lock_manager/connection.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Connection
constructor
A new instance of Connection.
- #read(key) ⇒ Object
- #remove(key) ⇒ Object
- #write(key, value) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Connection
Returns a new instance of Connection.
15 16 17 |
# File 'lib/lock_manager/connection.rb', line 15 def initialize( = {}) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/lock_manager/connection.rb', line 3 def @options end |
Class Method Details
.connection_class(type) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/lock_manager/connection.rb', line 5 def self.connection_class(type) case type.to_s when 'redis' require 'lock_manager/redis_connection' LockManager::RedisConnection else raise ArgumentError, "Unknown connection type: #{type}" end end |
Instance Method Details
#read(key) ⇒ Object
23 24 25 |
# File 'lib/lock_manager/connection.rb', line 23 def read(key) raise "Not implemented: read(#{key})" end |
#remove(key) ⇒ Object
27 28 29 |
# File 'lib/lock_manager/connection.rb', line 27 def remove(key) raise "Not implemented: remove(#{key})" end |
#write(key, value) ⇒ Object
19 20 21 |
# File 'lib/lock_manager/connection.rb', line 19 def write(key, value) raise "Not implemented: write(#{key}, #{value})" end |