Class: Rack::OauthProxy::Client::Request
- Inherits:
-
Object
- Object
- Rack::OauthProxy::Client::Request
- Defined in:
- lib/rack/oauth_proxy/client/request.rb
Constant Summary collapse
- DEFAULT_PROPAGATED_HEADER_FIELDS =
["Authorization"]
- DEFAULT_PROPAGATED_PARAMS =
["access_token", "bearer_token"]
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #header ⇒ Object
- #header_with_nil_value ⇒ Object
-
#initialize(env, options = {}) ⇒ Request
constructor
A new instance of Request.
- #params ⇒ Object
Constructor Details
#initialize(env, options = {}) ⇒ Request
Returns a new instance of Request.
15 16 17 18 |
# File 'lib/rack/oauth_proxy/client/request.rb', line 15 def initialize(env, = {}) @env = env @options = end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
13 14 15 |
# File 'lib/rack/oauth_proxy/client/request.rb', line 13 def env @env end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
13 14 15 |
# File 'lib/rack/oauth_proxy/client/request.rb', line 13 def @options end |
Instance Method Details
#header ⇒ Object
20 21 22 |
# File 'lib/rack/oauth_proxy/client/request.rb', line 20 def header header_with_nil_value.reject {|key, value| value.nil? } end |
#header_with_nil_value ⇒ Object
24 25 26 27 28 |
# File 'lib/rack/oauth_proxy/client/request.rb', line 24 def header_with_nil_value propagated_header_fields.inject({}) do |result, field| result.merge(field => env["HTTP_" + field.gsub("-", "_").upcase]) end end |
#params ⇒ Object
30 31 32 |
# File 'lib/rack/oauth_proxy/client/request.rb', line 30 def params rack_request.params.slice(*propagated_params) end |