Class: Firebase::Admin::Messaging::Notification

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

Overview

A notification that can be included in a message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title: nil, body: nil, image: nil) ⇒ Notification

Parameters:

  • title (String, nil) (defaults to: nil)

    Title of the notification (optional).

  • body (String, nil) (defaults to: nil)

    Body of the notification (optional).

  • Image (String, nil)

    url of the notification (optional).



26
27
28
29
30
# File 'lib/firebase/admin/messaging/notification.rb', line 26

def initialize(title: nil, body: nil, image: nil)
  self.title = title
  self.body = body
  self.image = image
end

Instance Attribute Details

#bodyString?

Returns Body of the notification.

Returns:

  • (String, nil)

    Body of the notification.



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

def body
  @body
end

#imageString?

Returns Image url of the notification.

Returns:

  • (String, nil)

    Image url of the notification.



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

def image
  @image
end

#titleString?

Returns Title of the notification.

Returns:

  • (String, nil)

    Title of the notification.



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

def title
  @title
end