Class: NagiosResque::Check::ResqueRedis
- Inherits:
-
Object
- Object
- NagiosResque::Check::ResqueRedis
- Defined in:
- lib/nagios_resque/check.rb
Instance Method Summary collapse
- #get(key) ⇒ Object
-
#initialize(options) ⇒ ResqueRedis
constructor
A new instance of ResqueRedis.
- #lrem(key, count, value) ⇒ Object
- #namespaced(key) ⇒ Object
- #rpush(key, value) ⇒ Object
- #sadd(key, value) ⇒ Object
Constructor Details
#initialize(options) ⇒ ResqueRedis
Returns a new instance of ResqueRedis.
53 54 55 56 |
# File 'lib/nagios_resque/check.rb', line 53 def initialize() @namespace = .delete(:namespace) @redis = Redis.new .merge(:thread_safe => true) end |
Instance Method Details
#get(key) ⇒ Object
62 63 64 |
# File 'lib/nagios_resque/check.rb', line 62 def get(key) @redis.get namespaced(key) end |
#lrem(key, count, value) ⇒ Object
68 69 70 |
# File 'lib/nagios_resque/check.rb', line 68 def lrem(key, count, value) @redis.lrem namespaced(key), count, value end |
#namespaced(key) ⇒ Object
58 59 60 |
# File 'lib/nagios_resque/check.rb', line 58 def namespaced(key) "#{@namespace}:#{key}" end |
#rpush(key, value) ⇒ Object
71 72 73 |
# File 'lib/nagios_resque/check.rb', line 71 def rpush(key, value) @redis.rpush namespaced(key), value end |
#sadd(key, value) ⇒ Object
65 66 67 |
# File 'lib/nagios_resque/check.rb', line 65 def sadd(key, value) @redis.sadd namespaced(key), value end |