Class: HeyYouFcmPush::MessageObject::Notification

Inherits:
Object
  • Object
show all
Defined in:
lib/hey_you_fcm_push/message_object/notification.rb

Constant Summary collapse

TRANSLATED_KEYS =
%w[title body]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Notification.



7
8
9
10
11
12
13
# File 'lib/hey_you_fcm_push/message_object/notification.rb', line 7

def initialize(title:, body:, image: nil)
  @to_h = {
    title: title,
    body: body,
    image: image
  }.compact
end

Instance Attribute Details

#to_hObject (readonly)

Returns the value of attribute to_h.



6
7
8
# File 'lib/hey_you_fcm_push/message_object/notification.rb', line 6

def to_h
  @to_h
end