Sha256: 7f8b7ca0a8c3672f821223fe682f96b5099ffcc65c19d6a653366c9c2e70290e

Contents?: true

Size: 703 Bytes

Versions: 3

Compression:

Stored size: 703 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 = "http://api.twitter.com/1" + path
        #path = TwitterAuth.path_prefix + path
        path = append_extension_to(path)

        response = super

        handle_response(response)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
twitter-auth-with-mongo-mapper-0.1.1 lib/twitter_auth/dispatcher/oauth.rb
twitter-auth-with-mongo-mapper-0.1.0 lib/twitter_auth/dispatcher/oauth.rb
twitter-auth-with-mongo-mapper-0.0.9 lib/twitter_auth/dispatcher/oauth.rb