Class: ServiceNow::Connection

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

Instance Method Summary collapse

Constructor Details

#initialize(instance_id, token) ⇒ Connection

Returns a new instance of Connection.



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/servicenow/connection.rb', line 8

def initialize(instance_id, token)
  @instance_id = instance_id
  @token = token

  @connection = Faraday::Connection.new(connection_options) do |conn|
    conn.use HttpErrors

    conn.authorization :Bearer, @token
    conn.request :json
    conn.response :json
    conn.adapter Faraday.default_adapter
  end
end