Class: Wee::Response
Constant Summary
collapse
{}.freeze
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(mime_type = 'text/html', content = '') ⇒ Response
Returns a new instance of Response.
18
19
20
21
22
23
|
# File 'lib/wee/response.rb', line 18
def initialize(mime_type = 'text/html', content='')
@status = 200
@header = DEFAULT_HEADER.dup
self.content_type = mime_type
@content = content
end
|
Instance Attribute Details
Returns the value of attribute content.
7
8
9
|
# File 'lib/wee/response.rb', line 7
def content
@content
end
|
Returns the value of attribute header.
8
9
10
|
# File 'lib/wee/response.rb', line 8
def
@header
end
|
Returns the value of attribute status.
7
8
9
|
# File 'lib/wee/response.rb', line 7
def status
@status
end
|
Instance Method Details
33
34
35
|
# File 'lib/wee/response.rb', line 33
def <<(str)
@content << str
end
|
#content_type ⇒ Object
25
26
27
|
# File 'lib/wee/response.rb', line 25
def content_type
@header['Content-Type']
end
|
#content_type=(mime_type) ⇒ Object
29
30
31
|
# File 'lib/wee/response.rb', line 29
def content_type=(mime_type)
@header['Content-Type'] = mime_type
end
|
14
15
16
|
# File 'lib/wee/response.rb', line 14
def cookies
@cookies ||= []
end
|
#cookies? ⇒ Boolean
10
11
12
|
# File 'lib/wee/response.rb', line 10
def cookies?
@cookies
end
|