Class: TwitterAuth::Dispatcher::Oauth

Inherits:
OAuth::AccessToken
  • Object
show all
Includes:
Shared
Defined in:
lib/twitter_auth/dispatcher/oauth.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Shared

#append_extension_to, #handle_response

Constructor Details

#initialize(user) ⇒ Oauth

Returns a new instance of Oauth.

Raises:



10
11
12
13
14
# File 'lib/twitter_auth/dispatcher/oauth.rb', line 10

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

Instance Attribute Details

#userObject

Returns the value of attribute user.



8
9
10
# File 'lib/twitter_auth/dispatcher/oauth.rb', line 8

def user
  @user
end

Instance Method Details

#request(http_method, path, *arguments) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/twitter_auth/dispatcher/oauth.rb', line 16

def request(http_method, path, *arguments)
  path = append_extension_to(path)
 
  response = super

  handle_response(response)
end