Class: Retailcrm::Response
- Inherits:
-
Object
- Object
- Retailcrm::Response
- Defined in:
- lib/retailcrm.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, body) ⇒ Response
constructor
A new instance of Response.
- #is_successfull? ⇒ Boolean
Constructor Details
#initialize(status, body) ⇒ Response
Returns a new instance of Response.
694 695 696 697 |
# File 'lib/retailcrm.rb', line 694 def initialize(status, body) @status = status @response = body.empty? ? [] : JSON.parse(body) end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
692 693 694 |
# File 'lib/retailcrm.rb', line 692 def response @response end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
692 693 694 |
# File 'lib/retailcrm.rb', line 692 def status @status end |
Instance Method Details
#is_successfull? ⇒ Boolean
699 700 701 |
# File 'lib/retailcrm.rb', line 699 def is_successfull? @status.to_i < 400 end |