class Resque::Plugins::Logstash::Transport::Redis
Attributes
key[R]
Public Class Methods
new(host, port = nil, key = 'logstash')
click to toggle source
# File lib/resque/logstash/transport/redis.rb, line 5 def initialize(host, port = nil, key = 'logstash') if host.is_a?(Hash) initialize_with_keyword_arguments(host) else @redis_options = { host: host, port: port } @key = key end end
Public Instance Methods
host()
click to toggle source
# File lib/resque/logstash/transport/redis.rb, line 30 def host @redis_options[:host] end
initialize_with_keyword_arguments(key: 'logstash', redis: nil, **redis_options)
click to toggle source
# File lib/resque/logstash/transport/redis.rb, line 14 def initialize_with_keyword_arguments(key: 'logstash', redis: nil, **redis_options) @key = key if redis @redis = redis else @redis_options = redis_options end end
port()
click to toggle source
# File lib/resque/logstash/transport/redis.rb, line 34 def port @redis_options[:port] end
push(value)
click to toggle source
# File lib/resque/logstash/transport/redis.rb, line 38 def push(value) redis.rpush @key, value.to_json end
redis()
click to toggle source
# File lib/resque/logstash/transport/redis.rb, line 26 def redis @redis ||= ::Redis.new(@redis_options) end