Class: Request
- Inherits:
-
Object
- Object
- Request
- Defined in:
- lib/primate/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#cookies ⇒ Object
readonly
Returns the value of attribute cookies.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(request, helpers) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(request, helpers) ⇒ Request
Returns a new instance of Request.
10 11 12 13 14 15 16 17 |
# File 'lib/primate/request.rb', line 10 def initialize(request, helpers) @url = Primate::URL.new(request['url']) @body = RequestBody.new(request['body'], helpers) @path = RequestBag.new(request['path'], helpers) @query = RequestBag.new(request['query'], helpers) @headers = RequestBag.new(request['headers'], helpers) @cookies = RequestBag.new(request['cookies'], helpers) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
8 9 10 |
# File 'lib/primate/request.rb', line 8 def body @body end |
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
8 9 10 |
# File 'lib/primate/request.rb', line 8 def @cookies end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
8 9 10 |
# File 'lib/primate/request.rb', line 8 def headers @headers end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/primate/request.rb', line 8 def path @path end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
8 9 10 |
# File 'lib/primate/request.rb', line 8 def query @query end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
8 9 10 |
# File 'lib/primate/request.rb', line 8 def url @url end |