Class: Gaurun::Notification
- Inherits:
-
Object
- Object
- Gaurun::Notification
- Defined in:
- lib/gaurun-ruby/notification.rb
Defined Under Namespace
Classes: Android, IOS, PlatformAbstract
Instance Attribute Summary collapse
-
#android ⇒ Object
Returns the value of attribute android.
-
#ios ⇒ Object
Returns the value of attribute ios.
Instance Method Summary collapse
-
#initialize(message: '') ⇒ Notification
constructor
A new instance of Notification.
- #payload ⇒ Object
Constructor Details
#initialize(message: '') ⇒ Notification
Returns a new instance of Notification.
7 8 9 10 |
# File 'lib/gaurun-ruby/notification.rb', line 7 def initialize(message: '') @ios = Gaurun::Notification::IOS.new(message: ) @android = Gaurun::Notification::Android.new(message: ) end |
Instance Attribute Details
#android ⇒ Object
Returns the value of attribute android.
5 6 7 |
# File 'lib/gaurun-ruby/notification.rb', line 5 def android @android end |
#ios ⇒ Object
Returns the value of attribute ios.
5 6 7 |
# File 'lib/gaurun-ruby/notification.rb', line 5 def ios @ios end |
Instance Method Details
#payload ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/gaurun-ruby/notification.rb', line 12 def payload notifications = [ @ios.payload, @android.payload, ].delete_if { |v| v.empty? } return nil if notifications.empty? { notifications: notifications, } end |