Class: LinkedIn::Configuration

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

Overview

Configuration for the LinkedIn gem.

LinkedIn.configure do |config|
  config.client_id     = ENV["LINKEDIN_CLIENT_ID"]
  config.client_secret = ENV["LINKEDIN_CLIENT_SECRET"]
end

The default endpoints for LinkedIn are also stored here.

LinkedIn uses the term “API key” to refer to “client id”. They also use the term “Secret Key” to refer to “client_secret”. We alias those terms in the config.

  • LinkedIn.config.site = “www.linkedin.com

  • LinkedIn.config.token_url = “/uas/oauth2/accessToken”

  • LinkedIn.config.authorize_url = “/uas/oauth2/authorization”

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.


33
34
35
36
37
38
39
# File 'lib/linked_in/configuration.rb', line 33

def initialize
  @api = "https://api.linkedin.com"
  @api_version = "/v2"
  @site = "https://www.linkedin.com"
  @token_url = "/uas/oauth2/accessToken"
  @authorize_url = "/uas/oauth2/authorization"
end

Instance Attribute Details

#apiObject

Returns the value of attribute api


19
20
21
# File 'lib/linked_in/configuration.rb', line 19

def api
  @api
end

#api_versionObject

Returns the value of attribute api_version


19
20
21
# File 'lib/linked_in/configuration.rb', line 19

def api_version
  @api_version
end

#authorize_urlObject

Returns the value of attribute authorize_url


19
20
21
# File 'lib/linked_in/configuration.rb', line 19

def authorize_url
  @authorize_url
end

#client_idObject Also known as: api_key

Returns the value of attribute client_id


19
20
21
# File 'lib/linked_in/configuration.rb', line 19

def client_id
  @client_id
end

#client_secretObject Also known as: secret_key

Returns the value of attribute client_secret


19
20
21
# File 'lib/linked_in/configuration.rb', line 19

def client_secret
  @client_secret
end

#default_profile_fieldsObject

Returns the value of attribute default_profile_fields


19
20
21
# File 'lib/linked_in/configuration.rb', line 19

def default_profile_fields
  @default_profile_fields
end

#redirect_uriObject

Returns the value of attribute redirect_uri


19
20
21
# File 'lib/linked_in/configuration.rb', line 19

def redirect_uri
  @redirect_uri
end

#scopeObject

Returns the value of attribute scope


19
20
21
# File 'lib/linked_in/configuration.rb', line 19

def scope
  @scope
end

#siteObject

Returns the value of attribute site


19
20
21
# File 'lib/linked_in/configuration.rb', line 19

def site
  @site
end

#token_urlObject

Returns the value of attribute token_url


19
20
21
# File 'lib/linked_in/configuration.rb', line 19

def token_url
  @token_url
end