Class: LinkedinToken
- Inherits:
-
ConsumerToken
- Object
- ConsumerToken
- LinkedinToken
- Defined in:
- lib/muck_oauth/services/linkedin_token.rb
Constant Summary collapse
- LINKEDIN_SETTINGS =
{ :site => "https://api.linkedin.com", :request_token_path => "/uas/oauth/requestToken", :access_token_path => "/uas/oauth/accessToken", :authorize_path => "/uas/oauth/authorize" }
Class Method Summary collapse
- .consumer ⇒ Object
- .create_consumer(options = {}) ⇒ Object
- .get_request_token(callback_url) ⇒ Object
Instance Method Summary collapse
Class Method Details
.consumer ⇒ Object
11 12 13 |
# File 'lib/muck_oauth/services/linkedin_token.rb', line 11 def self.consumer @consumer ||= create_consumer end |
.create_consumer(options = {}) ⇒ Object
15 16 17 |
# File 'lib/muck_oauth/services/linkedin_token.rb', line 15 def self.create_consumer(={}) OAuth::Consumer.new(credentials[:key], credentials[:secret], LINKEDIN_SETTINGS.merge()) end |
.get_request_token(callback_url) ⇒ Object
19 20 21 |
# File 'lib/muck_oauth/services/linkedin_token.rb', line 19 def self.get_request_token(callback_url) consumer.get_request_token({ :oauth_callback => callback_url }) end |
Instance Method Details
#client ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/muck_oauth/services/linkedin_token.rb', line 23 def client unless @client @client = ::LinkedIn::Client.new(LinkedinToken.consumer.key, LinkedinToken.consumer.secret) @client.(token, secret) end @client end |