Class: EzLinkedin::Client
- Inherits:
-
Object
- Object
- EzLinkedin::Client
- Includes:
- Api::QueryMethods, Api::UpdateMethods, Request, Search
- Defined in:
- lib/ezlinkedin/client.rb
Constant Summary
Constants included from Request
Request::API_PATH, Request::DEFAULT_HEADERS
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#consumer_key ⇒ Object
readonly
Returns the value of attribute consumer_key.
-
#consumer_options ⇒ Object
Returns the value of attribute consumer_options.
-
#consumer_secret ⇒ Object
readonly
Returns the value of attribute consumer_secret.
Instance Method Summary collapse
-
#authorize(token, token_secret) ⇒ Object
Create and outh access token to make api calls with param: token - the access token obtained from omniauth param: token_secret - the access token secret obtained from omniauth.
-
#initialize(c_key = EzLinkedin.token, c_secret = EzLinkedin.secret, options = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from Search
Methods included from Api::UpdateMethods
Methods included from Api::QueryMethods
#company, #connections, #group_memberships, #network_updates, #profile
Constructor Details
#initialize(c_key = EzLinkedin.token, c_secret = EzLinkedin.secret, options = {}) ⇒ Client
Returns a new instance of Client.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ezlinkedin/client.rb', line 13 def initialize(c_key=EzLinkedin.token, c_secret=EzLinkedin.secret, ={}) @consumer_key = c_key @consumer_secret = c_secret @consumer_options = { site: 'https://api.linkedin.com', request_token_path: '/uas/oauth/requestToken', access_token_path: '/uas/oauth/accessToken', authorize_path: '/uas/oauth/authorize' } @consumer_options.merge() @client = OAuth::Consumer.new(c_key, c_secret, @consumer_options) end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
10 11 12 |
# File 'lib/ezlinkedin/client.rb', line 10 def access_token @access_token end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
10 11 12 |
# File 'lib/ezlinkedin/client.rb', line 10 def client @client end |
#consumer_key ⇒ Object (readonly)
Returns the value of attribute consumer_key.
10 11 12 |
# File 'lib/ezlinkedin/client.rb', line 10 def consumer_key @consumer_key end |
#consumer_options ⇒ Object
Returns the value of attribute consumer_options.
11 12 13 |
# File 'lib/ezlinkedin/client.rb', line 11 def @consumer_options end |
#consumer_secret ⇒ Object (readonly)
Returns the value of attribute consumer_secret.
10 11 12 |
# File 'lib/ezlinkedin/client.rb', line 10 def consumer_secret @consumer_secret end |
Instance Method Details
#authorize(token, token_secret) ⇒ Object
Create and outh access token to make api calls with param: token - the access token obtained from omniauth param: token_secret - the access token secret obtained from omniauth
27 28 29 |
# File 'lib/ezlinkedin/client.rb', line 27 def (token, token_secret) @access_token = OAuth::AccessToken.new(@client, token, token_secret) end |