Class: LoopsSdk::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/loops_sdk/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



7
8
9
# File 'lib/loops_sdk/configuration.rb', line 7

def api_key
  @api_key
end

Instance Method Details

#connectionObject



9
10
11
12
13
14
15
# File 'lib/loops_sdk/configuration.rb', line 9

def connection
  @connection ||= Faraday.new(url: "https://app.loops.so/api/") do |faraday|
    faraday.adapter Faraday.default_adapter
    faraday.headers["Authorization"] = "Bearer #{api_key}"
    faraday.headers["Content-Type"] = "application/json"
  end
end