Class: Firebase::Admin::Messaging::BatchResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/firebase/admin/messaging/batch_response.rb

Overview

The response received from a batch request

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(responses:) ⇒ BatchResponse

A response received from a batch request.

Parameters:



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_countInteger (readonly)

The number of failed messages.

Returns:

  • (Integer)


16
17
18
# File 'lib/firebase/admin/messaging/batch_response.rb', line 16

def failure_count
  @failure_count
end

#responsesArray<SendResponse> (readonly)

The list of responses (possibly empty).

Returns:



8
9
10
# File 'lib/firebase/admin/messaging/batch_response.rb', line 8

def responses
  @responses
end

#success_countInteger (readonly)

The number of successful messages.

Returns:

  • (Integer)


12
13
14
# File 'lib/firebase/admin/messaging/batch_response.rb', line 12

def success_count
  @success_count
end