Module: Vra::Http

Defined in:
lib/vra/http.rb

Defined Under Namespace

Classes: Error, Request, Response

Class Method Summary collapse

Class Method Details

.error(response) ⇒ Object



15
16
17
# File 'lib/vra/http.rb', line 15

def self.error(response)
  Error.from_response(response)
end

.execute(params) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/vra/http.rb', line 7

def self.execute(params)
  request = Request.new(params)
  response = request.call
  response = response.forward(request).call until response.final?
  raise error(response) unless response.success?
  response
end