Module: RackToolkit::Server::ResponseEnhancer
- Defined in:
- lib/rack_toolkit/response_enhancer.rb
Instance Method Summary collapse
Instance Method Details
#error? ⇒ Boolean
19 20 21 |
# File 'lib/rack_toolkit/response_enhancer.rb', line 19 def error? !(ok? || redirect?) end |
#headers ⇒ Object
23 24 25 |
# File 'lib/rack_toolkit/response_enhancer.rb', line 23 def headers @headers ||= to_hash end |
#ok? ⇒ Boolean
11 12 13 |
# File 'lib/rack_toolkit/response_enhancer.rb', line 11 def ok? code == '200' end |
#redirect? ⇒ Boolean
15 16 17 |
# File 'lib/rack_toolkit/response_enhancer.rb', line 15 def redirect? Net::HTTPRedirection === self end |
#status_code ⇒ Object
7 8 9 |
# File 'lib/rack_toolkit/response_enhancer.rb', line 7 def status_code @status_code ||= code.to_i end |