Class: Less::Response
- Inherits:
-
Object
- Object
- Less::Response
- Defined in:
- lib/less_interactions/response.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
Returns the value of attribute object.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #client_error? ⇒ Boolean
- #error? ⇒ Boolean
-
#initialize(status, object) ⇒ Response
constructor
A new instance of Response.
- #server_error? ⇒ Boolean
- #success? ⇒ Boolean
Constructor Details
#initialize(status, object) ⇒ Response
Returns a new instance of Response.
4 5 6 7 |
# File 'lib/less_interactions/response.rb', line 4 def initialize(status, object) @status = status @object = object end |
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object.
3 4 5 |
# File 'lib/less_interactions/response.rb', line 3 def object @object end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/less_interactions/response.rb', line 3 def status @status end |
Instance Method Details
#client_error? ⇒ Boolean
17 18 19 |
# File 'lib/less_interactions/response.rb', line 17 def client_error? (400..499).cover? status end |
#error? ⇒ Boolean
13 14 15 |
# File 'lib/less_interactions/response.rb', line 13 def error? !success? end |
#server_error? ⇒ Boolean
21 22 23 |
# File 'lib/less_interactions/response.rb', line 21 def server_error? (500..599).cover? status end |
#success? ⇒ Boolean
9 10 11 |
# File 'lib/less_interactions/response.rb', line 9 def success? (200..299).cover? status end |