Class: Logbert::Handlers::RedisQueueHandler
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- Logbert::Handlers::RedisQueueHandler
- Defined in:
- lib/logbert/handlers/redis_handler.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#redis ⇒ Object
Returns the value of attribute redis.
Instance Method Summary collapse
-
#initialize(redis_connection, key, options = {}) ⇒ RedisQueueHandler
constructor
A new instance of RedisQueueHandler.
- #publish(message) ⇒ Object
Methods inherited from BaseHandler
#emit, #formatter, #formatter=
Constructor Details
#initialize(redis_connection, key, options = {}) ⇒ RedisQueueHandler
Returns a new instance of RedisQueueHandler.
11 12 13 14 |
# File 'lib/logbert/handlers/redis_handler.rb', line 11 def initialize(redis_connection, key, = {}) @redis = redis_connection @key = key end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
9 10 11 |
# File 'lib/logbert/handlers/redis_handler.rb', line 9 def key @key end |
#redis ⇒ Object
Returns the value of attribute redis.
9 10 11 |
# File 'lib/logbert/handlers/redis_handler.rb', line 9 def redis @redis end |
Instance Method Details
#publish(message) ⇒ Object
16 17 18 |
# File 'lib/logbert/handlers/redis_handler.rb', line 16 def publish() redis.lpush(@key, .to_json) end |