Class: EventMachine::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/appbooster-server/response.rb

Direct Known Subclasses

HttpResponse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResponse

Returns a new instance of Response.



8
9
10
# File 'lib/appbooster-server/response.rb', line 8

def initialize
  @headers = {}
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



6
7
8
# File 'lib/appbooster-server/response.rb', line 6

def content
  @content
end

#headersObject

Returns the value of attribute headers.



6
7
8
# File 'lib/appbooster-server/response.rb', line 6

def headers
  @headers
end

#statusObject

Returns the value of attribute status.



6
7
8
# File 'lib/appbooster-server/response.rb', line 6

def status
  @status
end

Instance Method Details

#content_type(type) ⇒ Object



18
19
20
# File 'lib/appbooster-server/response.rb', line 18

def content_type type
  @headers["Content-type"] = type || 'text/plain'
end

#send_responseObject



12
13
14
15
16
# File 'lib/appbooster-server/response.rb', line 12

def send_response
  send_headers
  send_body
  close_connection_after_writing
end