class LaunchShortcutAction

Category: Applications

Public Class Methods

new(obj=nil) click to toggle source
Calls superclass method ApplicationAction::new
# 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    
  options = {
    :app_name=>"Amazon Alexa", :intent_encoded=>"", :name=>"Ask Alexa"
  }

  super(options.merge h)
  
  #@list = %w(appName intentEncoded name)

end

Public Instance Methods

to_s(colour: false, indent: 0) click to toggle source
Calls superclass method MacroObject#to_s
# 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
Also aliased as: to_summary
to_summary(colour: false, indent: 0)
Alias for: to_s