Class: TwitterToken
Constant Summary
collapse
{
:site => "https://api.twitter.com",
:request_token_path => "/oauth/request_token",
:authorize_path => "/oauth/authorize",
:access_token_path => "/oauth/access_token",
}
Class Method Summary
collapse
Instance Method Summary
collapse
find_or_create_from_access_token
included
Class Method Details
.consumer(options = {}) ⇒ Object
9
10
11
|
# File 'lib/oauth/models/consumers/services/twitter_token.rb', line 9
def self.consumer(options={})
@consumer ||= OAuth::Consumer.new(credentials[:key], credentials[:secret], TWITTER_SETTINGS.merge(options))
end
|
Instance Method Details
#client ⇒ Object
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/oauth/models/consumers/services/twitter_token.rb', line 13
def client
@client ||= begin
if self.class.credentials[:client].to_sym == :oauth_gem
super
else
require 'twitter'
Twitter::Client.new(:consumer_key => self.class.consumer.key, :consumer_secret => self.class.consumer.secret)
end
end
end
|