Module: Riddl::Roles::OAuth::AccessToken
- Defined in:
- lib/ruby/riddl/roles/http%3A%2F%2Foauth.net%2F1.0%2Faccess_token.rb
Constant Summary collapse
- WANTED =
[:consumer_key, :consumer_secret, :token, :token_secret, :verifier]
Class Method Summary collapse
- .after(fullpath, method, code, response, headers, options) ⇒ Object
- .before(fullpath, method, parameters, headers, options) ⇒ Object
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%2Faccess_token.rb', line 10 def self::after(fullpath,method,code,response,headers,) 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%2Faccess_token.rb', line 18 def self::before(fullpath,method,parameters,headers,) unless WANTED.all?{ |e| .has_key?(e) } raise ArgumentError, "Riddl::Options have to include: #{WANTED.join(', ')}" end Riddl::Roles::OAuth::sign(fullpath,method,parameters,headers,) end |