Class: Firebase::Admin::Messaging::SendResponse

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

Overview

The response received from an individual batched request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message_id:, error:) ⇒ SendResponse

Initializes the object.

Parameters:

  • message_id (String, nil)

    the id of the sent message

  • error (Error, nil)

    the error that occurred



24
25
26
27
# File 'lib/firebase/admin/messaging/send_response.rb', line 24

def initialize(message_id:, error:)
  @message_id = message_id
  @error = error
end

Instance Attribute Details

#errorError (readonly)

The error if one occurred while sending the message.

Returns:



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

def error
  @error
end

#message_idString (readonly)

A message id string that uniquely identifies the message.

Returns:

  • (String)


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

def message_id
  @message_id
end

Instance Method Details

#success?Boolean

A boolean indicating if the request was successful.

Returns:

  • (Boolean)


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

def success?
  !!@message_id
end