Class: Innate::Response
- Inherits:
-
Rack::Response
- Object
- Rack::Response
- Innate::Response
- Includes:
- Optioned
- Defined in:
- lib/innate/response.rb
Overview
In order to reset the body contents we also need to reset the length set by Response#write - until I can submit a patch to Rack and the next release we just do this.
Instance Attribute Summary collapse
-
#length ⇒ Object
Returns the value of attribute length.
Instance Method Summary collapse
Methods included from Optioned
Instance Attribute Details
#length ⇒ Object
Returns the value of attribute length.
15 16 17 |
# File 'lib/innate/response.rb', line 15 def length @length end |
Instance Method Details
#finish ⇒ Object
25 26 27 28 |
# File 'lib/innate/response.rb', line 25 def finish .headers.each{|key, value| self[key] ||= value } super end |
#reset ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/innate/response.rb', line 17 def reset self.status = 200 self.header.delete('Content-Type') body.clear self.length = 0 self end |