Module: Riddl::Roles::OAuth::RequestToken

Defined in:
lib/ruby/riddl/roles/http%3A%2F%2Foauth.net%2F1.0%2Frequest_token.rb

Constant Summary collapse

WANTED =
[:consumer_key, :consumer_secret]

Class Method Summary collapse

Class Method Details

.after(fullpath, method, code, response, headers, options) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/ruby/riddl/roles/http%3A%2F%2Foauth.net%2F1.0%2Frequest_token.rb', line 10

def self::after(fullpath,method,code,response,headers,options)
  if code == 200
    Riddl::Roles::OAuth::Response.new(response[0].value.read)
  else  
    response
  end
end

.before(fullpath, method, parameters, headers, options) ⇒ Object



18
19
20
21
22
23
# File 'lib/ruby/riddl/roles/http%3A%2F%2Foauth.net%2F1.0%2Frequest_token.rb', line 18

def self::before(fullpath,method,parameters,headers,options)
  unless WANTED.all?{ |e| options.has_key?(e) }
    raise ArgumentError, "Riddl::Options have to include: #{WANTED.join(', ')}"
  end
  Riddl::Roles::OAuth::sign(fullpath,method,parameters,headers,options)
end