Class: Net::HTTPRequest

Inherits:
Object
  • Object
show all
Includes:
OAuth::Helper
Defined in:
lib/oauth/client/net_http.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from OAuth::Helper

#escape, #generate_key, #generate_timestamp, #normalize, #parse_header, #unescape

Instance Attribute Details

#oauth_helperObject (readonly)

Returns the value of attribute oauth_helper.



8
9
10
# File 'lib/oauth/client/net_http.rb', line 8

def oauth_helper
  @oauth_helper
end

Instance Method Details

#oauth!(http, consumer = nil, token = nil, options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/oauth/client/net_http.rb', line 10

def oauth!(http, consumer = nil, token = nil, options = {})
  options = { :request_uri      => oauth_full_request_uri(http),
              :consumer         => consumer,
              :token            => token,
              :scheme           => 'header',
              :signature_method => nil,
              :nonce            => nil,
              :timestamp        => nil }.merge(options)

  @oauth_helper = OAuth::Client::Helper.new(self, options)
  self.send("set_oauth_#{options[:scheme]}")
end

#signature_base_string(http, consumer = nil, token = nil, options = {}) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/oauth/client/net_http.rb', line 23

def signature_base_string(http, consumer = nil, token = nil, options = {})
  options = { :request_uri      => oauth_full_request_uri(http),
              :consumer         => consumer,
              :token            => token,
              :scheme           => 'header',
              :signature_method => nil,
              :nonce            => nil,
              :timestamp        => nil }.merge(options)

  OAuth::Client::Helper.new(self, options).signature_base_string
end