Class: Chain::BatchResponse
- Inherits:
-
Object
- Object
- Chain::BatchResponse
- Defined in:
- lib/chain/batch_response.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#successes ⇒ Object
readonly
Returns the value of attribute successes.
Instance Method Summary collapse
-
#initialize(successes: {}, errors: {}, response: nil) ⇒ BatchResponse
constructor
A new instance of BatchResponse.
- #size ⇒ Object
Constructor Details
#initialize(successes: {}, errors: {}, response: nil) ⇒ BatchResponse
Returns a new instance of BatchResponse.
9 10 11 12 13 |
# File 'lib/chain/batch_response.rb', line 9 def initialize(successes: {}, errors: {}, response: nil) @successes = ensure_key_sorting(successes) @errors = ensure_key_sorting(errors) @response = response end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
19 20 21 |
# File 'lib/chain/batch_response.rb', line 19 def errors @errors end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
19 20 21 |
# File 'lib/chain/batch_response.rb', line 19 def response @response end |
#successes ⇒ Object (readonly)
Returns the value of attribute successes.
19 20 21 |
# File 'lib/chain/batch_response.rb', line 19 def successes @successes end |
Instance Method Details
#size ⇒ Object
15 16 17 |
# File 'lib/chain/batch_response.rb', line 15 def size successes.size + errors.size end |