Exception: Roistat::Error

Inherits:
StandardError
  • Object
show all
Defined in:
sig/roistat.rbs,
lib/roistat/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, code: nil, http_status: nil, response_body: nil) ⇒ Error

Returns a new instance of Error.



6
7
8
9
10
11
# File 'lib/roistat/errors.rb', line 6

def initialize(message = nil, code: nil, http_status: nil, response_body: nil)
  @code = code
  @http_status = http_status
  @response_body = response_body
  super(message || code || self.class.name)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/roistat/errors.rb', line 4

def code
  @code
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



4
5
6
# File 'lib/roistat/errors.rb', line 4

def http_status
  @http_status
end

#response_bodyObject (readonly)

Returns the value of attribute response_body.



4
5
6
# File 'lib/roistat/errors.rb', line 4

def response_body
  @response_body
end