Module: TyphoeusOAuth::OAuthExtension::InstanceMethods
- Includes:
- OAuth::Helper
- Defined in:
- lib/typhoeus_oauth/oauth_extension.rb
Instance Attribute Summary collapse
-
#oauth_helper ⇒ Object
readonly
Returns the value of attribute oauth_helper.
Instance Method Summary collapse
- #oauth!(consumer, token, options = {}) ⇒ Object
- #params ⇒ Object
- #post_data ⇒ Object
- #signature_base_string(consumer = nil, token = nil, options = {}) ⇒ Object
Instance Attribute Details
#oauth_helper ⇒ Object (readonly)
Returns the value of attribute oauth_helper.
18 19 20 |
# File 'lib/typhoeus_oauth/oauth_extension.rb', line 18 def oauth_helper @oauth_helper end |
Instance Method Details
#oauth!(consumer, token, options = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/typhoeus_oauth/oauth_extension.rb', line 20 def oauth!(consumer, token, = {}) = { :request_uri => oauth_full_request_uri, :consumer => consumer, :token => token, :scheme => 'header', :signature_method => nil, :nonce => nil, :timestamp => nil }.merge() @oauth_helper = OAuth::Client::Helper.new(self, ) @oauth_helper.amend_user_agent_header(@headers) self.send("set_oauth_#{[:scheme]}") end |
#params ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/typhoeus_oauth/oauth_extension.rb', line 46 def params query = if [:post, :put].include? method self.post_data else URI.parse(self.url).query end CGI::parse(query) end |
#post_data ⇒ Object
55 56 57 |
# File 'lib/typhoeus_oauth/oauth_extension.rb', line 55 def post_data @post_data ||= nil end |
#signature_base_string(consumer = nil, token = nil, options = {}) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/typhoeus_oauth/oauth_extension.rb', line 34 def signature_base_string(consumer = nil, token = nil, = {}) = { :request_uri => oauth_full_request_uri, :consumer => consumer, :token => token, :scheme => 'header', :signature_method => nil, :nonce => nil, :timestamp => nil }.merge() OAuth::Client::Helper.new(self, ).signature_base_string end |