Sha256: 06736b900a20041903440662c905719e03592ec0b6b530b9de9171597e5e5ff7

Contents?: true

Size: 614 Bytes

Versions: 4

Compression:

Stored size: 614 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 = append_extension_to(path)
       
        response = super

        handle_response(response)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
mbleigh-twitter-auth-0.1.12 lib/twitter_auth/dispatcher/oauth.rb
mbleigh-twitter-auth-0.1.13 lib/twitter_auth/dispatcher/oauth.rb
twitter-auth-0.1.13 lib/twitter_auth/dispatcher/oauth.rb
twitter-auth-0.1.12 lib/twitter_auth/dispatcher/oauth.rb