Module: Oauth::Contacts

Defined in:
lib/oauth-contacts.rb,
lib/oauth/contacts/base.rb,
lib/oauth/contacts/live.rb,
lib/oauth/contacts/google.rb,
lib/oauth/contacts/oauth2.rb,
lib/oauth/contacts/version.rb

Defined Under Namespace

Classes: APIAuthenticationError, Base, Google, Live, OAuth2, TypeNotFound

Constant Summary collapse

SUPPORTED_PROVIDERS =
['google', 'live']
VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.get_provider(provider) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/oauth-contacts.rb', line 20

def get_provider(provider)
  if !SUPPORTED_PROVIDERS.include?(provider)
    raise Oauth::Contacts::TypeNotFound, "#{provider} is not supported, please use one of the following : #{Oauth::Contacts.supported_providers}"
  end

  return ("Oauth::Contacts::" + provider.capitalize).constantize.new
end

.supported_providersObject



16
17
18
# File 'lib/oauth-contacts.rb', line 16

def supported_providers
  @providers ||= SUPPORTED_PROVIDERS.map(&:to_s).join(', ')
end