Sha256: a4eb8e318cd8b5c03990f1ff2d0a98bc6fc1b27965f955b7e3c784ee371fc9a6

Contents?: true

Size: 691 Bytes

Versions: 10

Compression:

Stored size: 691 Bytes

Contents

class TwitterToken < ConsumerToken
  TWITTER_SETTINGS={
    :site => "https://api.twitter.com",
    :request_token_path => "/oauth/request_token",
    :authorize_path => "/oauth/authorize",
    :access_token_path => "/oauth/access_token",
  }

  def self.consumer(options={})
    @consumer ||= OAuth::Consumer.new(credentials[:key], credentials[:secret], TWITTER_SETTINGS.merge(options))
  end

  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

end

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
houston-oauth-plugin-0.5.1 lib/oauth/models/consumers/services/twitter_token.rb
oauth_consumer-0.1.3 lib/oauth/models/consumers/services/twitter_token.rb
panjiva-oauth-plugin-0.4.1 lib/oauth/models/consumers/services/twitter_token.rb
oauth_consumer-0.1.2 lib/oauth/models/consumers/services/twitter_token.rb
oauth_consumer-0.1.1 lib/oauth/models/consumers/services/twitter_token.rb
oauth_consumer-0.1.0 lib/oauth/models/consumers/services/twitter_token.rb
oauth-plugin-0.5.1 lib/oauth/models/consumers/services/twitter_token.rb
oauth-plugin-0.5.0 lib/oauth/models/consumers/services/twitter_token.rb
oauth-plugin-0.4.1 lib/oauth/models/consumers/services/twitter_token.rb
oauth-plugin-0.4.0 lib/oauth/models/consumers/services/twitter_token.rb