Class: LaunchActivityAction

Inherits:
ApplicationAction show all
Defined in:
lib/ruby-macrodroid/actions.rb

Overview

Category: Applications

Instance Attribute Summary

Attributes inherited from Action

#constraints

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Action

#invoke

Methods included from ObjectX

#action_to_object, #object_create, #varify

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ LaunchActivityAction

Returns a new instance of LaunchActivityAction.



77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/ruby-macrodroid/actions.rb', line 77

def initialize(h={})

  options = {
    application_name: 'Chrome',
    package_to_launch: 'com.android.chrome',
    exclude_from_recents: false,
    start_new: false
  }

  super(options.merge h)

end

Instance Method Details

#to_s(colour: false, indent: 0) ⇒ Object



90
91
92
# File 'lib/ruby-macrodroid/actions.rb', line 90

def to_s(colour: false, indent: 0)
  'Launch ' + @h[:application_name]
end