Class: Firebase::Messaging::Request::Body
- Inherits:
-
Object
- Object
- Firebase::Messaging::Request::Body
- Defined in:
- lib/firebase/messaging/request/body.rb
Defined Under Namespace
Classes: Notification
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#notification ⇒ Object
Returns the value of attribute notification.
Instance Method Summary collapse
-
#initialize ⇒ Body
constructor
A new instance of Body.
- #payload ⇒ Object
Constructor Details
#initialize ⇒ Body
Returns a new instance of Body.
8 9 10 11 |
# File 'lib/firebase/messaging/request/body.rb', line 8 def initialize @notification = Notification.new # NOTE: title, body, badge, icon @data = {} # NOTE: custom data for app end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
6 7 8 |
# File 'lib/firebase/messaging/request/body.rb', line 6 def data @data end |
#notification ⇒ Object
Returns the value of attribute notification.
5 6 7 |
# File 'lib/firebase/messaging/request/body.rb', line 5 def notification @notification end |
Instance Method Details
#payload ⇒ Object
20 21 22 23 24 25 |
# File 'lib/firebase/messaging/request/body.rb', line 20 def payload = {} [:notification] = @notification.payload unless @notification.payload.empty? [:data] = @data unless @data.empty? end |