Method: FellowshipOneAPI::OAuth#load_consumer_config

Defined in:
lib/f1api/oauth.rb

#load_consumer_config(type = :portal) ⇒ Object

Creates the OAuth consumer object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/f1api/oauth.rb', line 33

def load_consumer_config(type = :portal)
  case type
  when :portal
    authorize_path = FellowshipOneAPI::Configuration.portal_authorize_path
  when :weblink
    authorize_path = FellowshipOneAPI::Configuration.weblink_authorize_path
  end

  @oauth_consumer_key ||= FellowshipOneAPI::Configuration.consumer_key
  @oauth_consumer_secret ||= FellowshipOneAPI::Configuration.consumer_secret

  @oauth_consumer = ::OAuth::Consumer.new(@oauth_consumer_key, 
                    @oauth_consumer_secret,
                    {:site => FellowshipOneAPI::Configuration.site_url,
                     :request_token_path => FellowshipOneAPI::Configuration.request_token_path,
                     :access_token_path => FellowshipOneAPI::Configuration.access_token_path,
                     :authorize_path => authorize_path })
end