Class: Gopher::Response
- Inherits:
-
Object
- Object
- Gopher::Response
- Defined in:
- lib/gopher2000/response.rb
Overview
basic class for server response to a request. contains the rendered results, a code that indicates success/failure, and can report the size of the response
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#code ⇒ Object
Returns the value of attribute code.
Instance Method Summary collapse
-
#size ⇒ Integer
get the size, in bytes, of the response.
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
9 10 11 |
# File 'lib/gopher2000/response.rb', line 9 def body @body end |
#code ⇒ Object
Returns the value of attribute code.
10 11 12 |
# File 'lib/gopher2000/response.rb', line 10 def code @code end |
Instance Method Details
#size ⇒ Integer
get the size, in bytes, of the response. used for logging
16 17 18 19 20 21 22 23 |
# File 'lib/gopher2000/response.rb', line 16 def size case self.body when String then self.body.length when StringIO then self.body.length when File then self.body.size else 0 end end |