Class: LaunchActivityAction
- Inherits:
-
ApplicationAction
- Object
- MacroObject
- Action
- ApplicationAction
- LaunchActivityAction
- Defined in:
- lib/ruby-macrodroid/actions.rb
Overview
Category: Applications
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ LaunchActivityAction
constructor
A new instance of LaunchActivityAction.
- #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 = {}) ⇒ LaunchActivityAction
Returns a new instance of LaunchActivityAction.
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/ruby-macrodroid/actions.rb', line 107 def initialize(h={}) # option 0 is by application name, 1 is launch by package name # = { application_name: 'Chrome', package_to_launch: 'com.android.chrome', exclude_from_recents: false, start_new: false, option: 0, launch_by_package_name: '' } super(.merge h) @list = %w(option launchByPackageName) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object
126 127 128 129 130 131 |
# File 'lib/ruby-macrodroid/actions.rb', line 126 def to_s(colour: false, indent: 0) option = @h[:option] == 0 ? @h[:application_name] : \ @h[:launch_by_package_name] @s = 'Launch ' + option super() end |