lib/qs/error_handler.rb in qs-0.7.1 vs lib/qs/error_handler.rb in qs-0.8.0

- old
+ new

@@ -39,15 +39,15 @@ attr_reader :daemon_data attr_reader :queue_name, :encoded_payload attr_reader :message, :handler_class def initialize(args) - @daemon_data = args[:daemon_data] - @queue_name = Queue::RedisKey.parse_name(args[:queue_redis_key].to_s) - @encoded_payload = args[:encoded_payload] - @message = args[:message] - @handler_class = args[:handler_class] + @daemon_data = args.fetch(:daemon_data) + @queue_name = get_queue_name(args.fetch(:queue_redis_key)) + @encoded_payload = args.fetch(:encoded_payload) + @message = args.fetch(:message) + @handler_class = args.fetch(:handler_class) end def ==(other) if other.kind_of?(self.class) self.daemon_data == other.daemon_data && @@ -57,8 +57,15 @@ self.handler_class == other.handler_class else super end end + + private + + def get_queue_name(redis_key) + Queue::RedisKey.parse_name(redis_key.to_s) + end + end end