Class: PageResponse
- Inherits:
-
Object
- Object
- PageResponse
- Defined in:
- lib/ribit/ribit.rb
Overview
Wrapper for response object used by Webrick
Instance Method Summary collapse
- #get_body ⇒ Object
- #get_content_type ⇒ Object
- #get_servlet_response ⇒ Object
-
#initialize(servletResponse) ⇒ PageResponse
constructor
A new instance of PageResponse.
- #set_body(data) ⇒ Object
- #set_content_type(type) ⇒ Object
- #set_header_field(name, value) ⇒ Object
- #status=(s) ⇒ Object
Constructor Details
#initialize(servletResponse) ⇒ PageResponse
Returns a new instance of PageResponse.
281 282 283 |
# File 'lib/ribit/ribit.rb', line 281 def initialize( servletResponse ) @servletResponse = servletResponse end |
Instance Method Details
#get_body ⇒ Object
291 292 293 |
# File 'lib/ribit/ribit.rb', line 291 def get_body @servletResponse.body end |
#get_content_type ⇒ Object
301 302 303 |
# File 'lib/ribit/ribit.rb', line 301 def get_content_type @servletResponse['Content-Type'] end |
#get_servlet_response ⇒ Object
306 307 308 |
# File 'lib/ribit/ribit.rb', line 306 def get_servlet_response return @servletResponse end |
#set_body(data) ⇒ Object
286 287 288 |
# File 'lib/ribit/ribit.rb', line 286 def set_body( data ) @servletResponse.body = data end |
#set_content_type(type) ⇒ Object
296 297 298 |
# File 'lib/ribit/ribit.rb', line 296 def set_content_type( type ) @servletResponse['Content-Type'] = type end |
#set_header_field(name, value) ⇒ Object
311 312 313 |
# File 'lib/ribit/ribit.rb', line 311 def set_header_field( name, value ) @servletResponse[name] = value end |
#status=(s) ⇒ Object
316 317 318 |
# File 'lib/ribit/ribit.rb', line 316 def status=(s) @servletResponse.status = s end |