Class: Mack::Response

Inherits:
Rack::Response show all
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

Attributes inherited from Rack::Response

#body, #header, #status

Attributes included from Rack::Response::Helpers

#headers, #original_headers

Instance Method Summary collapse

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

#controllerObject

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 attachment=(file_name)
  self['Content-Disposition'] = "attachment; filename=#{file_name}"
end

#content_typeObject



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