Class: OAuth::Signature::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_mapper/default_plugins/oauth.rb

Instance Method Summary collapse

Constructor Details

#initialize(request, options = {}, &block) ⇒ Base

Returns a new instance of Base.

Raises:

  • (TypeError)


10
11
12
13
14
15
16
17
18
19
# File 'lib/simple_mapper/default_plugins/oauth.rb', line 10

def initialize(request, options = {}, &block)
  raise TypeError unless request.kind_of?(OAuth::RequestProxy::Base)
  @request = request
  if block_given?
    @token_secret, @consumer_secret = yield block.arity == 1 ? token : [token, consumer_key,nonce,request.timestamp]
  else
    @consumer_secret = options[:consumer].respond_to?(:secret) ? options[:consumer].secret : options[:consumer]
    @token_secret = options[:token].respond_to?(:secret) ? options[:token].secret : (options[:token] || '')
  end
end