Parent

OAuth::ConsumerToken

Superclass for tokens used by OAuth Clients

Attributes

consumer[RW]
params[RW]
response[R]

Public Class Methods

from_hash(consumer, hash) click to toggle source
    # File lib/oauth/tokens/consumer_token.rb, line 7
 7:     def self.from_hash(consumer, hash)
 8:       token = self.new(consumer, hash[:oauth_token], hash[:oauth_token_secret])
 9:       token.params = hash
10:       token
11:     end
new(consumer, token="", secret="") click to toggle source
    # File lib/oauth/tokens/consumer_token.rb, line 13
13:     def initialize(consumer, token="", secret="")
14:       super(token, secret)
15:       @consumer = consumer
16:       @params   = {}
17:     end

Public Instance Methods

request(http_method, path, *arguments) click to toggle source

Make a signed request using given http_method to the path

  @token.request(:get,  '/people')
  @token.request(:post, '/people', @person.to_xml, { 'Content-Type' => 'application/xml' })
    # File lib/oauth/tokens/consumer_token.rb, line 24
24:     def request(http_method, path, *arguments)
25:       @response = consumer.request(http_method, path, self, {}, *arguments)
26:     end
sign!(request, options = {}) click to toggle source

Sign a request generated elsewhere using Net:HTTP::Post.new or friends

    # File lib/oauth/tokens/consumer_token.rb, line 29
29:     def sign!(request, options = {})
30:       consumer.sign!(request, self, options)
31:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.