Class: NotificationAction
- Inherits:
-
NotificationsAction
- Object
- MacroObject
- Action
- NotificationsAction
- NotificationAction
- Defined in:
- lib/ruby-macrodroid/actions.rb
Overview
Category: Notifications
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ NotificationAction
constructor
A new instance of NotificationAction.
- #to_s(colour: false, indent: 0) ⇒ Object
Methods inherited from Action
Methods included from ObjectX
#action_to_object, #object_create, #varify
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ NotificationAction
Returns a new instance of NotificationAction.
2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 |
# File 'lib/ruby-macrodroid/actions.rb', line 2446 def initialize(h={}) h[:notification_subject] = h[:subject] if h[:subject] h[:notification_text] = h[:text] if h[:text] = { ringtone_name: 'Default', notification_text: '', notification_subject: '', macro_guid_to_run: 0, notification_channel_type: 0, image_resource_id: 0, overwrite_existing: false, priority: 0, ringtone_index: 0, icon_bg_color: -1762269, run_macro_when_pressed: false } super(.merge filter(, h)) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object
2469 2470 2471 2472 2473 |
# File 'lib/ruby-macrodroid/actions.rb', line 2469 def to_s(colour: false, indent: 0) @s = "Display Notification\n" + \ "%s: %s" % [@h[:notification_subject], @h[:notification_text]] super() end |