Class: NerdLog::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



18
19
20
# File 'lib/nerd_log.rb', line 18

def api_key
  @api_key
end

Instance Method Details

#http_connectionObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/nerd_log.rb', line 20

def http_connection
  @connection ||= Faraday.new(url: 'https://www.warcraftlogs.com/v1/',
                              params: {api_key: self.api_key}) do |faraday|
    faraday.request :url_encoded
    faraday.request :json

    faraday.response :json
    faraday.adapter Faraday.default_adapter
  end
end