Class: Liberty::Adapters::Request
- Inherits:
-
Object
- Object
- Liberty::Adapters::Request
- Defined in:
- lib/liberty/adapters/request.rb
Constant Summary collapse
- PARSED_BODY =
"parsed_body"
- ROUTER_PARAMS =
"router.params"
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #headers ⇒ Object
-
#initialize(env = nil) ⇒ Request
constructor
A new instance of Request.
- #params ⇒ Object
Constructor Details
#initialize(env = nil) ⇒ Request
Returns a new instance of Request.
13 14 15 |
# File 'lib/liberty/adapters/request.rb', line 13 def initialize(env = nil) @env = env end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
11 12 13 |
# File 'lib/liberty/adapters/request.rb', line 11 def env @env end |
Instance Method Details
#headers ⇒ Object
17 18 19 20 21 22 |
# File 'lib/liberty/adapters/request.rb', line 17 def headers @headers ||= env ? { accept_media_types: accept_media_types, preferred_media_type: preferred_media_type } : {} end |
#params ⇒ Object
24 25 26 |
# File 'lib/liberty/adapters/request.rb', line 24 def params @params ||= env ? all_params : {} end |