Class: Bluzelle::Swarm::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/bluzelle/swarm/request.rb

Class Method Summary collapse

Class Method Details

.execute(options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/bluzelle/swarm/request.rb', line 9

def execute(options = {})
  resp = RestClient::Request.execute(parse_options(options))
rescue RestClient::ExceptionWithResponse => e
  case e.http_code
  when 404, 500
    raise Error::ApiError, e.response.body
  else
    error(e)
  end
else
  success(resp)
end