Class: LaunchShortcutAction
- Inherits:
-
ApplicationAction
- Object
- MacroObject
- Action
- ApplicationAction
- LaunchShortcutAction
- 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(obj = nil) ⇒ LaunchShortcutAction
constructor
A new instance of LaunchShortcutAction.
- #to_s(colour: false, indent: 0) ⇒ Object (also: #to_summary)
Methods inherited from Action
Methods included from ObjectX
#action_to_object, #object_create, #varify
Methods inherited from MacroObject
Constructor Details
#initialize(obj = nil) ⇒ LaunchShortcutAction
Returns a new instance of LaunchShortcutAction.
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/ruby-macrodroid/actions.rb', line 161 def initialize(obj=nil) puts 'obj: ' + obj.inspect h = if obj.is_a? Hash then obj else obj[2] || {} end if h[:shortcut] and h[:shortcut] =~ /Ask Alexa/i then h = { :app_name=>"Amazon Alexa", :intent_encoded=>"#Intent;action=com." + "amazon.alexa.action.WIDGET_SHORTCUT;launchFlags=0x10000000;" + "component=com.amazon.dee.app/.ui.voice.LaunchAlexaActivity;end", :name=>"Ask Alexa" } end = { :app_name=>"Amazon Alexa", :intent_encoded=>"", :name=>"Ask Alexa" } super(.merge h) #@list = %w(appName intentEncoded name) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary
188 189 190 191 |
# File 'lib/ruby-macrodroid/actions.rb', line 188 def to_s(colour: false, indent: 0) @s = "Launch Shortcut: " + @h[:app_name] + "\n" + @h[:name] super() end |