Class: Sanford::ErrorContext

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ ErrorContext

Returns a new instance of ErrorContext.



78
79
80
81
82
83
# File 'lib/sanford/error_handler.rb', line 78

def initialize(args)
  @server_data   = args.fetch(:server_data)
  @request       = args.fetch(:request)
  @handler_class = args.fetch(:handler_class)
  @response      = args.fetch(:response)
end

Instance Attribute Details

#handler_classObject (readonly)

Returns the value of attribute handler_class.



76
77
78
# File 'lib/sanford/error_handler.rb', line 76

def handler_class
  @handler_class
end

#requestObject (readonly)

Returns the value of attribute request.



76
77
78
# File 'lib/sanford/error_handler.rb', line 76

def request
  @request
end

#responseObject (readonly)

Returns the value of attribute response.



76
77
78
# File 'lib/sanford/error_handler.rb', line 76

def response
  @response
end

#server_dataObject (readonly)

Returns the value of attribute server_data.



75
76
77
# File 'lib/sanford/error_handler.rb', line 75

def server_data
  @server_data
end

Instance Method Details

#==(other) ⇒ Object



85
86
87
88
89
90
91
92
93
94
# File 'lib/sanford/error_handler.rb', line 85

def ==(other)
  if other.kind_of?(self.class)
    self.server_data   == other.server_data   &&
    self.request       == other.request       &&
    self.handler_class == other.handler_class &&
    self.response      == other.response
  else
    super
  end
end