Class: Copy::Storage::Redis
- Inherits:
-
Object
- Object
- Copy::Storage::Redis
- Defined in:
- lib/copy/storage/redis.rb
Instance Method Summary collapse
- #get(name) ⇒ Object
-
#initialize(connection_url) ⇒ Redis
constructor
A new instance of Redis.
- #set(name, content) ⇒ Object
Constructor Details
#initialize(connection_url) ⇒ Redis
Returns a new instance of Redis.
4 5 6 |
# File 'lib/copy/storage/redis.rb', line 4 def initialize(connection_url) @redis = ::Redis.new(connection_url) end |
Instance Method Details
#get(name) ⇒ Object
8 9 10 |
# File 'lib/copy/storage/redis.rb', line 8 def get(name) @redis.hget("copy:content", name) end |
#set(name, content) ⇒ Object
12 13 14 |
# File 'lib/copy/storage/redis.rb', line 12 def set(name, content) @redis.hset("copy:content", name, content) end |