Class: TwitterToken

Inherits:
ConsumerToken
  • Object
show all
Defined in:
lib/oauth/models/consumers/services/twitter_token.rb

Constant Summary collapse

TWITTER_SETTINGS =
{:site=>"http://twitter.com"}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.consumerObject



4
5
6
# File 'lib/oauth/models/consumers/services/twitter_token.rb', line 4

def self.consumer
  @consumer||=OAuth::Consumer.new credentials[:key],credentials[:secret],TWITTER_SETTINGS
end

Instance Method Details

#clientObject



8
9
10
11
12
13
14
15
16
# File 'lib/oauth/models/consumers/services/twitter_token.rb', line 8

def client
  unless @client
    @twitter_oauth=Twitter::OAuth.new TwitterToken.consumer.key,TwitterToken.consumer.secret
    @twitter_oauth.authorize_from_access token,secret
    @client=Twitter::Base.new(@twitter_oauth)
  end
  
  @client
end