Class: Contacts::Provider::OAuth2

Inherits:
Base
  • Object
show all
Defined in:
lib/contacts/provider/oauth2.rb

Direct Known Subclasses

Facebook

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

all, #attributes, #attributes=, #connection, #contacts, #contacts_response, #initialize, #parse_attributes, #parse_contacts!, provider_id, #retrieve_contacts!, #site_url, #valid_attributes, valid_attributes, valid_attributes=

Constructor Details

This class inherits a constructor from Contacts::Provider::Base

Class Method Details

.inherited(klass) ⇒ Object



6
7
8
# File 'lib/contacts/provider/oauth2.rb', line 6

def self.inherited klass
  klass.valid_attributes = self.valid_attributes
end

Instance Method Details

#clientObject



12
13
14
# File 'lib/contacts/provider/oauth2.rb', line 12

def client
  @client ||= ::OAuth2::Client.new(consumer_key, consumer_secret, :site => site_url)
end

#connect!Object



16
17
18
# File 'lib/contacts/provider/oauth2.rb', line 16

def connect!
  ::OAuth2::AccessToken.new(client, token)
end