Class: Firebase::Admin::Messaging::BatchResponse
- Inherits:
-
Object
- Object
- Firebase::Admin::Messaging::BatchResponse
- Defined in:
- lib/firebase/admin/messaging/batch_response.rb
Overview
The response received from a batch request
Instance Attribute Summary collapse
-
#failure_count ⇒ Integer
readonly
The number of failed messages.
-
#responses ⇒ Array<SendResponse>
readonly
The list of responses (possibly empty).
-
#success_count ⇒ Integer
readonly
The number of successful messages.
Instance Method Summary collapse
-
#initialize(responses:) ⇒ BatchResponse
constructor
A response received from a batch request.
Constructor Details
#initialize(responses:) ⇒ BatchResponse
A response received from a batch request.
21 22 23 24 25 |
# File 'lib/firebase/admin/messaging/batch_response.rb', line 21 def initialize(responses:) @responses = responses @success_count = responses.count(:success?) @failure_count = responses.count - @success_count end |
Instance Attribute Details
#failure_count ⇒ Integer (readonly)
The number of failed messages.
16 17 18 |
# File 'lib/firebase/admin/messaging/batch_response.rb', line 16 def failure_count @failure_count end |
#responses ⇒ Array<SendResponse> (readonly)
The list of responses (possibly empty).
8 9 10 |
# File 'lib/firebase/admin/messaging/batch_response.rb', line 8 def responses @responses end |
#success_count ⇒ Integer (readonly)
The number of successful messages.
12 13 14 |
# File 'lib/firebase/admin/messaging/batch_response.rb', line 12 def success_count @success_count end |