Class: WebfleetConnect::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/webfleet_connect/connection.rb

Instance Method Summary collapse

Constructor Details

#initialize(session) ⇒ Connection

Returns a new instance of Connection.



9
10
11
12
# File 'lib/webfleet_connect/connection.rb', line 9

def initialize(session)
  @session = session
  @error_parser = build_error_parser(session)
end

Instance Method Details

#exec(url) ⇒ Object

Raises:



14
15
16
17
18
# File 'lib/webfleet_connect/connection.rb', line 14

def exec(url)
  response = get(url)
  raise Error.new(response.body, url, json?) if error?(response.body)
  Response.new(response, url, json?)
end