Class: NotificationTrigger
- Inherits:
-
DeviceEventsTrigger
- Object
- MacroObject
- Trigger
- DeviceEventsTrigger
- NotificationTrigger
- Defined in:
- lib/ruby-macrodroid/triggers.rb
Overview
Category: Device Events
Instance Attribute Summary
Attributes inherited from Trigger
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ NotificationTrigger
constructor
A new instance of NotificationTrigger.
- #to_s(colour: false) ⇒ Object (also: #to_summary)
Methods inherited from Trigger
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ NotificationTrigger
Returns a new instance of NotificationTrigger.
1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1113 def initialize(h={}) = { text_content: '', package_name_list: ["Any Application"], application_name_list: ["Any Application"], exclude_apps: false, ignore_ongoing: true, option: 0, exact_match: false, excludes: false, sound_option: 0, supress_multiples: true, enable_regex: false } super(.merge h) end |
Instance Method Details
#to_s(colour: false) ⇒ Object Also known as: to_summary
1133 1134 1135 1136 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1133 def to_s(colour: false) s = (@h[:package_name_list] + @h[:application_name_list]).uniq.join(', ') 'Notification Received ' + "\n Any Content (%s)" % s end |