Exception: Vhx::VhxError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/vhx/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_body, response_status, url) ⇒ VhxError

Returns a new instance of VhxError.


5
6
7
8
9
10
11
12
# File 'lib/vhx/error.rb', line 5

def initialize(response_body, response_status, url)
  @response_body   = response_body
  @response_status = response_status
  @url             = url
  @message         = response_body.is_a?(Hash) ? response_body['message'] : response_body.to_s

  super(@message)
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.


3
4
5
# File 'lib/vhx/error.rb', line 3

def message
  @message
end

#response_bodyObject (readonly)

Returns the value of attribute response_body.


3
4
5
# File 'lib/vhx/error.rb', line 3

def response_body
  @response_body
end

#response_statusObject (readonly)

Returns the value of attribute response_status.


3
4
5
# File 'lib/vhx/error.rb', line 3

def response_status
  @response_status
end

#urlObject (readonly)

Returns the value of attribute url.


3
4
5
# File 'lib/vhx/error.rb', line 3

def url
  @url
end