Class: IonicPush::Push::Notification
- Inherits:
-
Object
- Object
- IonicPush::Push::Notification
- Defined in:
- lib/ionic_push/push/notification.rb
Instance Attribute Summary collapse
-
#notification ⇒ Object
Returns the value of attribute notification.
-
#tokens ⇒ Object
Returns the value of attribute tokens.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(tokens, notification = nil) ⇒ Notification
constructor
A new instance of Notification.
Constructor Details
#initialize(tokens, notification = nil) ⇒ Notification
Returns a new instance of Notification.
6 7 8 9 10 |
# File 'lib/ionic_push/push/notification.rb', line 6 def initialize(tokens, notification = nil) @tokens = tokens @notification = notification = {} end |
Instance Attribute Details
#notification ⇒ Object
Returns the value of attribute notification.
4 5 6 |
# File 'lib/ionic_push/push/notification.rb', line 4 def notification @notification end |
#tokens ⇒ Object
Returns the value of attribute tokens.
4 5 6 |
# File 'lib/ionic_push/push/notification.rb', line 4 def tokens @tokens end |
Instance Method Details
#body ⇒ Object
12 13 14 15 16 |
# File 'lib/ionic_push/push/notification.rb', line 12 def body raise ArgumentError, 'Notification params must be a Hash' unless @notification.respond_to?(:to_hash) .merge!(device_tokens) .merge!(notification: notification) end |