Class: TwitterDispatch::Proxy::OAuth

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Shared

#append_extension_to, #handle_response

Constructor Details

#initialize(dispatcher) ⇒ OAuth

Returns a new instance of OAuth.



8
9
10
11
# File 'lib/twitter_dispatch/proxy/oauth.rb', line 8

def initialize(dispatcher)
  self.dispatcher = dispatcher
  super(dispatcher.consumer, dispatcher.access_token, dispatcher.access_secret)
end

Instance Attribute Details

#dispatcherObject

Returns the value of attribute dispatcher.



6
7
8
# File 'lib/twitter_dispatch/proxy/oauth.rb', line 6

def dispatcher
  @dispatcher
end

Instance Method Details

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



13
14
15
16
17
18
19
20
# File 'lib/twitter_dispatch/proxy/oauth.rb', line 13

def request(http_method, path, *arguments)
  path = dispatcher.path_prefix + path
  path = append_extension_to(path)

  response = super

  handle_response(response)
end