Class: LinkedIn::Client
Instance Method Summary
collapse
Methods included from API
included
included
#configuration, #reset
#config, #configure, #load
Constructor Details
#initialize(**config, &block) ⇒ Client
Returns a new instance of Client.
6
7
8
|
# File 'lib/linkedin/client.rb', line 6
def initialize(**config, &block)
configure config, &block
end
|
Instance Method Details
#connection ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/linkedin/client.rb', line 14
def connection
@connection ||= Faraday.new 'https://api.linkedin.com' do |conn|
conn.request :json
conn.request :url_encoded
conn.request :linkedin_credentials, configuration
conn.request :linkedin_format
conn.request :linkedin_user_agent
conn.response :linkedin_errors
conn.response :mashify
conn.response :logger, configuration.logger
conn.response :json, content_type: /\bjson$/
conn.adapter Faraday.default_adapter
end
end
|
#credentials ⇒ Object
10
11
12
|
# File 'lib/linkedin/client.rb', line 10
def credentials
@credentials ||= Credentials.new configuration
end
|
31
32
33
|
# File 'lib/linkedin/client.rb', line 31
def
@headers ||= {}
end
|
#params ⇒ Object
35
36
37
|
# File 'lib/linkedin/client.rb', line 35
def params
@params ||= {}
end
|