Class: Riddl::Handlers::OAuth

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby/riddl/handlers/oauth.rb

Constant Summary collapse

WANTED =
[:oauth_token,:oauth_token_secret]

Class Method Summary collapse

Class Method Details

.handle(what, hinfo) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/ruby/riddl/handlers/oauth.rb', line 6

def self::handle(what,hinfo)
  provided = []
  qs = what.read
  (qs || '').split(/[&] */n).each do |p|
    k, v = Protocols::Utils::unescape(p).split('=', 2)
    provided << k.to_sym
  end
  WANTED.all?{ |e| provided.include?(e) }
end