Class: ForceMacroRunAction
Instance Attribute Summary
Attributes inherited from Action
#constraints
Attributes inherited from MacroObject
#options, #siguid, #type
Instance Method Summary
collapse
Methods included from ObjectX
#action_to_object, #object_create, #varify
Methods inherited from MacroObject
#to_h
Constructor Details
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
|
# File 'lib/ruby-macrodroid/actions.rb', line 1975
def initialize(obj=nil)
h = if obj.is_a? Hash then
obj
elsif obj.is_a? Array
e, macro, h2 = obj
name = e.text('item/description').to_s
found = macro.parent.macros.find {|macro| macro.title =~ /#{name}/ }
h3 = if found then
{macro_name: found.title, GUID: found.guid}
else
{macro_name: name}
end
h3.merge h2
end
options = {
guid: nil, ignore_constraints: true,
macro_name: "", use_off_status: false,
user_prompt_title: "Run Macro"
}
super(options.merge h)
end
|
Instance Method Details
#invoke ⇒ Object
2008
2009
2010
|
# File 'lib/ruby-macrodroid/actions.rb', line 2008
def invoke()
super(macro_name: @h[:macro_name])
end
|
#to_s(colour: false, indent: 0) ⇒ Object
Also known as:
to_summary
2012
2013
2014
2015
2016
2017
2018
|
# File 'lib/ruby-macrodroid/actions.rb', line 2012
def to_s(colour: false, indent: 0)
@s = 'Macro Run'
@s += "\n" + @h[:macro_name]
super()
end
|