Class: Organizai::Response
- Inherits:
-
Object
- Object
- Organizai::Response
- Defined in:
- lib/organizai/response.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#http ⇒ Object
readonly
Returns the value of attribute http.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(http_response, format) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(http_response, format) ⇒ Response
Returns a new instance of Response.
6 7 8 9 10 11 |
# File 'lib/organizai/response.rb', line 6 def initialize(http_response,format) @http_response = http_response @format = format @error = http_response.code != "200" set_response_object end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
4 5 6 |
# File 'lib/organizai/response.rb', line 4 def error @error end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
4 5 6 |
# File 'lib/organizai/response.rb', line 4 def format @format end |
#http ⇒ Object (readonly)
Returns the value of attribute http.
4 5 6 |
# File 'lib/organizai/response.rb', line 4 def http @http end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
4 5 6 |
# File 'lib/organizai/response.rb', line 4 def object @object end |
Instance Method Details
#error? ⇒ Boolean
13 14 15 |
# File 'lib/organizai/response.rb', line 13 def error? @error end |
#success? ⇒ Boolean
17 18 19 |
# File 'lib/organizai/response.rb', line 17 def success? !error? end |