Module: Restfulie::Client::HTTP::ResponseStatus
- Included in:
- Net::HTTPResponse
- Defined in:
- lib/restfulie/client/cache/http_ext.rb
Overview
an extesion to http responses
Instance Attribute Summary collapse
-
#previous ⇒ Object
Returns the value of attribute previous.
Instance Method Summary collapse
- #etag ⇒ Object
-
#is_client_error? ⇒ Boolean
determines if this response code was successful (according to http specs: 400~499).
-
#is_informational? ⇒ Boolean
determines if this response code was successful (according to http specs: 100~199).
-
#is_redirection? ⇒ Boolean
determines if this response code was successful (according to http specs: 300~399).
-
#is_server_error? ⇒ Boolean
determines if this response code was successful (according to http specs: 500~599).
-
#is_successful? ⇒ Boolean
determines if this response code was successful (according to http specs: 200~299).
- #last_modified ⇒ Object
Instance Attribute Details
#previous ⇒ Object
Returns the value of attribute previous.
6 7 8 |
# File 'lib/restfulie/client/cache/http_ext.rb', line 6 def previous @previous end |
Instance Method Details
#etag ⇒ Object
33 34 35 |
# File 'lib/restfulie/client/cache/http_ext.rb', line 33 def etag self['Etag'] end |
#is_client_error? ⇒ Boolean
determines if this response code was successful (according to http specs: 400~499)
24 25 26 |
# File 'lib/restfulie/client/cache/http_ext.rb', line 24 def is_client_error? code.to_i >= 400 && code.to_i <= 499 end |
#is_informational? ⇒ Boolean
determines if this response code was successful (according to http specs: 100~199)
14 15 16 |
# File 'lib/restfulie/client/cache/http_ext.rb', line 14 def is_informational? code.to_i >= 100 && code.to_i <= 199 end |
#is_redirection? ⇒ Boolean
determines if this response code was successful (according to http specs: 300~399)
19 20 21 |
# File 'lib/restfulie/client/cache/http_ext.rb', line 19 def is_redirection? code.to_i >= 300 && code.to_i <= 399 end |
#is_server_error? ⇒ Boolean
determines if this response code was successful (according to http specs: 500~599)
29 30 31 |
# File 'lib/restfulie/client/cache/http_ext.rb', line 29 def is_server_error? code.to_i >= 500 && code.to_i <= 599 end |
#is_successful? ⇒ Boolean
determines if this response code was successful (according to http specs: 200~299)
9 10 11 |
# File 'lib/restfulie/client/cache/http_ext.rb', line 9 def is_successful? code.to_i >= 200 && code.to_i <= 299 end |
#last_modified ⇒ Object
37 38 39 |
# File 'lib/restfulie/client/cache/http_ext.rb', line 37 def last_modified self['Last-Modified'] end |