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.
1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1180 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
1200 1201 1202 1203 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1200 def to_s(colour: false) s = (@h[:package_name_list] + @h[:application_name_list]).uniq.join(', ') 'Notification Received ' + "\n Any Content (%s)" % s end |