Class: ApplicationLaunchedTrigger
- Inherits:
-
Trigger
- Object
- MacroObject
- Trigger
- ApplicationLaunchedTrigger
- Defined in:
- lib/ruby-macrodroid/triggers.rb
Overview
Category: Applications
Instance Attribute Summary
Attributes inherited from Trigger
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ ApplicationLaunchedTrigger
constructor
A new instance of ApplicationLaunchedTrigger.
- #to_s(colour: false) ⇒ Object (also: #to_summary)
Methods inherited from Trigger
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ ApplicationLaunchedTrigger
Returns a new instance of ApplicationLaunchedTrigger.
124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/ruby-macrodroid/triggers.rb', line 124 def initialize(h={}) = { application_name_list: ["Chrome"], package_name_list: ["com.android.chrome"], launched: true } super(.merge h) end |
Instance Method Details
#to_s(colour: false) ⇒ Object Also known as: to_summary
136 137 138 139 140 |
# File 'lib/ruby-macrodroid/triggers.rb', line 136 def to_s(colour: false) a = @h[:application_name_list] apps = a.length > 1 ? "[%s]" % a.join(', ') : a.first 'Application Launched' + "\n " + apps end |