Class: Rivulet::Request
- Inherits:
-
Object
- Object
- Rivulet::Request
- Defined in:
- lib/rivulet/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #cookies ⇒ Object
-
#initialize(env) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(env) ⇒ Request
Returns a new instance of Request.
5 6 7 8 9 10 11 12 |
# File 'lib/rivulet/request.rb', line 5 def initialize(env) @http_method = env['REQUEST_METHOD'].downcase.to_sym @path = env['PATH_INFO'] @content_type = env['CONTENT_TYPE'] @body = env['rack.input'] @session = env['rack.session'] @env = env end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/rivulet/request.rb', line 3 def body @body end |
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
3 4 5 |
# File 'lib/rivulet/request.rb', line 3 def content_type @content_type end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
3 4 5 |
# File 'lib/rivulet/request.rb', line 3 def env @env end |
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
3 4 5 |
# File 'lib/rivulet/request.rb', line 3 def http_method @http_method end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/rivulet/request.rb', line 3 def path @path end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
3 4 5 |
# File 'lib/rivulet/request.rb', line 3 def session @session end |
Instance Method Details
#cookies ⇒ Object
14 15 16 |
# File 'lib/rivulet/request.rb', line 14 def Rack::Utils.(env) end |