Class: Hubspot::BatchResponse
- Defined in:
- lib/hubspot/batch.rb
Overview
exactly the same as a parsed_response but with the status code preserved
Instance Attribute Summary collapse
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#all_successful? ⇒ Boolean
Check if all responses were successful (status 200).
-
#initialize(status_code, parsed_response) ⇒ BatchResponse
constructor
A new instance of BatchResponse.
-
#partial_success? ⇒ Boolean
Check if some responses succeeded and some failed (status 207).
Constructor Details
#initialize(status_code, parsed_response) ⇒ BatchResponse
Returns a new instance of BatchResponse.
10 11 12 13 |
# File 'lib/hubspot/batch.rb', line 10 def initialize(status_code, parsed_response) @status_code = status_code super(parsed_response) # Delegate to the parsed response object end |
Instance Attribute Details
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
8 9 10 |
# File 'lib/hubspot/batch.rb', line 8 def status_code @status_code end |
Instance Method Details
#all_successful? ⇒ Boolean
Check if all responses were successful (status 200)
16 17 18 |
# File 'lib/hubspot/batch.rb', line 16 def all_successful? @status_code == 200 end |
#partial_success? ⇒ Boolean
Check if some responses succeeded and some failed (status 207)
21 22 23 |
# File 'lib/hubspot/batch.rb', line 21 def partial_success? @status_code == 207 end |