Exception: Vra::Http::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/vra/http.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, http_code, response) ⇒ Error

Returns a new instance of Error.



144
145
146
147
148
# File 'lib/vra/http.rb', line 144

def initialize(message, http_code, response)
  super(message)
  @http_code = http_code
  @response = response
end

Instance Attribute Details

#http_codeObject (readonly)

Returns the value of attribute http_code.



141
142
143
# File 'lib/vra/http.rb', line 141

def http_code
  @http_code
end

#responseObject (readonly)

Returns the value of attribute response.



142
143
144
# File 'lib/vra/http.rb', line 142

def response
  @response
end

Class Method Details

.from_response(http_response) ⇒ Object



137
138
139
# File 'lib/vra/http.rb', line 137

def self.from_response(http_response)
  new(http_response.message, http_response.code, http_response.body)
end