Class: Qs::ErrorContext

Inherits:
Object
  • Object
show all
Defined in:
lib/qs/error_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ ErrorContext

Returns a new instance of ErrorContext.



43
44
45
46
47
48
49
# File 'lib/qs/error_handler.rb', line 43

def initialize(args)
  @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

Instance Attribute Details

#daemon_dataObject (readonly)

Returns the value of attribute daemon_data.



39
40
41
# File 'lib/qs/error_handler.rb', line 39

def daemon_data
  @daemon_data
end

#encoded_payloadObject (readonly)

Returns the value of attribute encoded_payload.



40
41
42
# File 'lib/qs/error_handler.rb', line 40

def encoded_payload
  @encoded_payload
end

#handler_classObject (readonly)

Returns the value of attribute handler_class.



41
42
43
# File 'lib/qs/error_handler.rb', line 41

def handler_class
  @handler_class
end

#messageObject (readonly)

Returns the value of attribute message.



41
42
43
# File 'lib/qs/error_handler.rb', line 41

def message
  @message
end

#queue_nameObject (readonly)

Returns the value of attribute queue_name.



40
41
42
# File 'lib/qs/error_handler.rb', line 40

def queue_name
  @queue_name
end

Instance Method Details

#==(other) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/qs/error_handler.rb', line 51

def ==(other)
  if other.kind_of?(self.class)
    self.daemon_data     == other.daemon_data &&
    self.queue_name      == other.queue_name &&
    self.encoded_payload == other.encoded_payload &&
    self.message         == other.message &&
    self.handler_class   == other.handler_class
  else
    super
  end
end