class EzLinkedin::Client

Attributes

access_token[R]
client[R]
consumer_key[R]
consumer_options[RW]
consumer_secret[R]

Public Class Methods

new(c_key=EzLinkedin.token, c_secret=EzLinkedin.secret, options={}) click to toggle source
# File lib/ezlinkedin/client.rb, line 13
def initialize(c_key=EzLinkedin.token, c_secret=EzLinkedin.secret, options={})
        @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(options)
        @client = OAuth::Consumer.new(c_key, c_secret, @consumer_options)
end

Public Instance Methods

authorize(token, token_secret) click to toggle source

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

# File lib/ezlinkedin/client.rb, line 27
def authorize(token, token_secret)
        @access_token = OAuth::AccessToken.new(@client, token, token_secret)
end