class OAuth::ConsumerToken
Superclass for tokens used by OAuth
Clients
Attributes
Public Class Methods
Source
# File lib/oauth/tokens/consumer_token.rb, line 9 def self.from_hash(consumer, hash) token = new(consumer, hash[:oauth_token], hash[:oauth_token_secret]) token.params = hash token end
Source
# File lib/oauth/tokens/consumer_token.rb, line 15 def initialize(consumer, token = "", secret = "") super(token, secret) @consumer = consumer @params = {} end
Calls superclass method
Public Instance Methods
Source
# File lib/oauth/tokens/consumer_token.rb, line 26 def request(http_method, path, *arguments) @response = consumer.request(http_method, path, self, {}, *arguments) end
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' })
Source
# File lib/oauth/tokens/consumer_token.rb, line 31 def sign!(request, options = {}) consumer.sign!(request, self, options) end
Sign a request generated elsewhere using Net:HTTP::Post.new or friends