Class: Maia::FCM::Notification

Inherits:
Object
  • Object
show all
Defined in:
lib/maia/fcm/notification.rb

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ Notification

Returns a new instance of Notification.



4
5
6
# File 'lib/maia/fcm/notification.rb', line 4

def initialize(message)
  @message = message
end

Instance Method Details

#bodyObject



12
13
14
# File 'lib/maia/fcm/notification.rb', line 12

def body
  @message.body
end

#imageObject



16
17
18
# File 'lib/maia/fcm/notification.rb', line 16

def image
  @message.image
end

#titleObject



8
9
10
# File 'lib/maia/fcm/notification.rb', line 8

def title
  @message.title
end

#to_hObject



20
21
22
23
24
25
26
# File 'lib/maia/fcm/notification.rb', line 20

def to_h
  {
    title: title,
    body:  body,
    image: image
  }.compact
end