Class: Vintage::RequestContext
- Inherits:
-
Object
- Object
- Vintage::RequestContext
- Defined in:
- lib/vintage/request_context.rb
Overview
A class that creates a context for template rendering. Helpers are mixed in here to give templates access to them.
Instance Attribute Summary collapse
-
#request ⇒ Object
Returns the value of attribute request.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #cookies ⇒ Object
-
#initialize(incoming_request) ⇒ RequestContext
constructor
A new instance of RequestContext.
- #set_cookie(key, val) ⇒ Object
Constructor Details
#initialize(incoming_request) ⇒ RequestContext
Returns a new instance of RequestContext.
23 24 25 26 |
# File 'lib/vintage/request_context.rb', line 23 def initialize(incoming_request) self.request = incoming_request self.response = Vintage::Response.new end |
Instance Attribute Details
#request ⇒ Object
Returns the value of attribute request.
21 22 23 |
# File 'lib/vintage/request_context.rb', line 21 def request @request end |
#response ⇒ Object
Returns the value of attribute response.
21 22 23 |
# File 'lib/vintage/request_context.rb', line 21 def response @response end |
Instance Method Details
#cookies ⇒ Object
28 29 30 |
# File 'lib/vintage/request_context.rb', line 28 def self.request. end |
#set_cookie(key, val) ⇒ Object
32 33 34 |
# File 'lib/vintage/request_context.rb', line 32 def (key, val) self.response.[key] = val end |