Class: ActionPushNative::ConfiguredNotification
- Inherits:
-
Object
- Object
- ActionPushNative::ConfiguredNotification
- Defined in:
- lib/action_push_native/configured_notification.rb
Instance Method Summary collapse
-
#initialize(notification_class) ⇒ ConfiguredNotification
constructor
A new instance of ConfiguredNotification.
- #new(**attributes) ⇒ Object
- #silent ⇒ Object
- #with_apple(apple_data) ⇒ Object
- #with_data(data) ⇒ Object
- #with_google(google_data) ⇒ Object
Constructor Details
#initialize(notification_class) ⇒ ConfiguredNotification
Returns a new instance of ConfiguredNotification.
3 4 5 6 |
# File 'lib/action_push_native/configured_notification.rb', line 3 def initialize(notification_class) @notification_class = notification_class = {} end |
Instance Method Details
#new(**attributes) ⇒ Object
8 9 10 |
# File 'lib/action_push_native/configured_notification.rb', line 8 def new(**attributes) notification_class.new(**attributes.merge()) end |
#silent ⇒ Object
17 18 19 20 |
# File 'lib/action_push_native/configured_notification.rb', line 17 def silent = .merge(high_priority: false) with_apple(aps: { "content-available": 1 }) end |
#with_apple(apple_data) ⇒ Object
22 23 24 25 |
# File 'lib/action_push_native/configured_notification.rb', line 22 def with_apple(apple_data) [:apple_data] = .fetch(:apple_data, {}).merge(apple_data) self end |
#with_data(data) ⇒ Object
12 13 14 15 |
# File 'lib/action_push_native/configured_notification.rb', line 12 def with_data(data) [:data] = .fetch(:data, {}).merge(data) self end |
#with_google(google_data) ⇒ Object
27 28 29 30 |
# File 'lib/action_push_native/configured_notification.rb', line 27 def with_google(google_data) [:google_data] = .fetch(:google_data, {}).merge(google_data) self end |