Sha256: 93c0a544f71e58b8b7a7eeaa43d5178b7b29d0dc68cde130acf7138d32e7721e

Contents?: true

Size: 628 Bytes

Versions: 10

Compression:

Stored size: 628 Bytes

Contents

require 'oauth'

module TwitterAuth
  module Dispatcher
    class Oauth < OAuth::AccessToken
      include TwitterAuth::Dispatcher::Shared

      attr_accessor :user

      def initialize(user)
        raise TwitterAuth::Error, 'Dispatcher must be initialized with a User.' unless user.is_a?(TwitterAuth::OauthUser) 
        self.user = user
        super(TwitterAuth.consumer, user.access_token, user.access_secret)
      end

      def request(http_method, path, *arguments)
        path << '.json' unless path.match(/\.(:?xml|json)\z/i)
        response = super

        handle_response(response)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
mbleigh-twitter-auth-0.1.10 lib/twitter_auth/dispatcher/oauth.rb
mbleigh-twitter-auth-0.1.11 lib/twitter_auth/dispatcher/oauth.rb
mbleigh-twitter-auth-0.1.5 lib/twitter_auth/dispatcher/oauth.rb
mbleigh-twitter-auth-0.1.8 lib/twitter_auth/dispatcher/oauth.rb
twitter-auth-0.1.10 lib/twitter_auth/dispatcher/oauth.rb
twitter-auth-0.1.11 lib/twitter_auth/dispatcher/oauth.rb
twitter-auth-0.1.5 lib/twitter_auth/dispatcher/oauth.rb
twitter-auth-0.1.8 lib/twitter_auth/dispatcher/oauth.rb
twitter-auth-0.1.7 lib/twitter_auth/dispatcher/oauth.rb
twitter-auth-0.1.9 lib/twitter_auth/dispatcher/oauth.rb