Class: Riddl::Roles::OAuth::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby/riddl/roles/http%3A%2F%2Foauth.net%2F1.0/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(qs) ⇒ Response

Returns a new instance of Response.



21
22
23
24
25
26
27
# File 'lib/ruby/riddl/roles/http%3A%2F%2Foauth.net%2F1.0/base.rb', line 21

def initialize(qs)
  @provided = {}
  (qs || '').split(/[&] */n).each do |p|
    k, v = Protocols::Utils::unescape(p).split('=', 2)
    @provided[k.to_sym] = v
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) ⇒ Object



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

def method_missing(name)
  @provided[name]
end

Instance Method Details

#itemsObject



17
18
19
# File 'lib/ruby/riddl/roles/http%3A%2F%2Foauth.net%2F1.0/base.rb', line 17

def items
  @provided.keys
end