Class: RedisMemory
- Inherits:
-
SharedMemory
- Object
- SharedMemory
- RedisMemory
- Defined in:
- lib/sharedmem/redis.rb
Instance Attribute Summary
Attributes inherited from SharedMemory
Instance Method Summary collapse
- #dispose ⇒ Object
- #get(name) ⇒ Object
-
#initialize(host = "localhost", port = 6679) ⇒ RedisMemory
constructor
A new instance of RedisMemory.
- #set(name, value) ⇒ Object
Methods inherited from SharedMemory
Constructor Details
#initialize(host = "localhost", port = 6679) ⇒ RedisMemory
Returns a new instance of RedisMemory.
4 5 6 |
# File 'lib/sharedmem/redis.rb', line 4 def initialize(host="localhost", port=6679) @redis = Redis.new(:host => host, :port => port) end |
Instance Method Details
#dispose ⇒ Object
7 8 |
# File 'lib/sharedmem/redis.rb', line 7 def dispose end |
#get(name) ⇒ Object
10 11 12 |
# File 'lib/sharedmem/redis.rb', line 10 def get(name) @redis.get name end |
#set(name, value) ⇒ Object
13 14 15 |
# File 'lib/sharedmem/redis.rb', line 13 def set(name, value) @redis.set name, value end |