Class: Navigable::Server::Request
- Inherits:
-
Object
- Object
- Navigable::Server::Request
- Defined in:
- lib/navigable/server/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.
11 12 13 |
# File 'lib/navigable/server/request.rb', line 11 def initialize(env = nil) @env = env end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
9 10 11 |
# File 'lib/navigable/server/request.rb', line 9 def env @env end |
Instance Method Details
#headers ⇒ Object
15 16 17 18 19 20 |
# File 'lib/navigable/server/request.rb', line 15 def headers @headers ||= env ? { accept_media_types: accept_media_types, preferred_media_type: preferred_media_type } : {} end |
#params ⇒ Object
22 23 24 |
# File 'lib/navigable/server/request.rb', line 22 def params @params ||= env ? form_params.merge!(body_params).merge!(url_params) : {} end |