Class: SynergyWholesale::BaseResponse
- Inherits:
-
Object
- Object
- SynergyWholesale::BaseResponse
- Defined in:
- lib/synergy_wholesale/base_response.rb
Direct Known Subclasses
CheckDomain::Response, DisableAutoRenewal::Response, DomainRegister::Response, DomainRegisterAu::Response, EnableAutoRenewal::Response
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(response, command) ⇒ BaseResponse
constructor
A new instance of BaseResponse.
- #message ⇒ Object
- #successful? ⇒ Boolean
Constructor Details
#initialize(response, command) ⇒ BaseResponse
Returns a new instance of BaseResponse.
6 7 8 9 10 11 12 13 |
# File 'lib/synergy_wholesale/base_response.rb', line 6 def initialize(response, command) @response = response @command = command validate_status validate_expected_fields validate_data end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
4 5 6 |
# File 'lib/synergy_wholesale/base_response.rb', line 4 def command @command end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/synergy_wholesale/base_response.rb', line 4 def response @response end |
Instance Method Details
#body ⇒ Object
23 24 25 |
# File 'lib/synergy_wholesale/base_response.rb', line 23 def body response end |
#message ⇒ Object
19 20 21 |
# File 'lib/synergy_wholesale/base_response.rb', line 19 def response[:error_message] end |
#successful? ⇒ Boolean
15 16 17 |
# File 'lib/synergy_wholesale/base_response.rb', line 15 def successful? [*success_statuses].include?(response[:status]) end |