Class: Mack::Response
- Inherits:
-
Rack::Response
- Object
- Rack::Response
- Mack::Response
- Defined in:
- lib/mack/controller/response.rb
Overview
Right now Mack::Response is just a wrapper around Rack::Response. Down the line this may be used to spice up the response.
Instance Attribute Summary collapse
-
#controller ⇒ Object
Returns the value of attribute controller.
Attributes inherited from Rack::Response
Attributes included from Rack::Response::Helpers
Instance Method Summary collapse
- #assigns(key) ⇒ Object
- #attachment=(file_name) ⇒ Object
- #content_type ⇒ Object
- #content_type=(type) ⇒ Object
Methods inherited from Rack::Response
#[], #[]=, #close, #delete_cookie, #each, #empty?, #finish, #initialize, #set_cookie, #write
Methods included from Rack::Response::Helpers
#client_error?, #content_length, #empty?, #forbidden?, #include?, #informational?, #invalid?, #location, #not_found?, #ok?, #redirect?, #redirection?, #server_error?, #successful?
Constructor Details
This class inherits a constructor from Rack::Response
Instance Attribute Details
#controller ⇒ Object
Returns the value of attribute controller.
6 7 8 |
# File 'lib/mack/controller/response.rb', line 6 def controller @controller end |
Instance Method Details
#assigns(key) ⇒ Object
8 9 10 |
# File 'lib/mack/controller/response.rb', line 8 def assigns(key) self.controller.instance_variable_get("@#{key}") end |
#attachment=(file_name) ⇒ Object
12 13 14 |
# File 'lib/mack/controller/response.rb', line 12 def (file_name) self['Content-Disposition'] = "attachment; filename=#{file_name}" end |
#content_type ⇒ Object
20 21 22 |
# File 'lib/mack/controller/response.rb', line 20 def content_type self['Content-Type'] end |
#content_type=(type) ⇒ Object
16 17 18 |
# File 'lib/mack/controller/response.rb', line 16 def content_type=(type) self['Content-Type'] = type end |