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.



37
38
39
40
41
42
43
# File 'lib/qs/error_handler.rb', line 37

def initialize(args)
  @daemon_data        = args[:daemon_data]
  @queue_name         = Queue::RedisKey.parse_name(args[:queue_redis_key].to_s)
  @serialized_payload = args[:serialized_payload]
  @job                = args[:job]
  @handler_class      = args[:handler_class]
end

Instance Attribute Details

#daemon_dataObject (readonly)

Returns the value of attribute daemon_data.



33
34
35
# File 'lib/qs/error_handler.rb', line 33

def daemon_data
  @daemon_data
end

#handler_classObject (readonly)

Returns the value of attribute handler_class.



35
36
37
# File 'lib/qs/error_handler.rb', line 35

def handler_class
  @handler_class
end

#jobObject (readonly)

Returns the value of attribute job.



35
36
37
# File 'lib/qs/error_handler.rb', line 35

def job
  @job
end

#queue_nameObject (readonly)

Returns the value of attribute queue_name.



34
35
36
# File 'lib/qs/error_handler.rb', line 34

def queue_name
  @queue_name
end

#serialized_payloadObject (readonly)

Returns the value of attribute serialized_payload.



34
35
36
# File 'lib/qs/error_handler.rb', line 34

def serialized_payload
  @serialized_payload
end

Instance Method Details

#==(other) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/qs/error_handler.rb', line 45

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