Class: IfConfirmedThenAction

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

Overview

Conditions/Loops

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 = {}) ⇒ IfConfirmedThenAction

Returns a new instance of IfConfirmedThenAction.



317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/ruby-macrodroid/actions.rb', line 317

def initialize(h={})
  
  options = {
    a: true,
    constraint_list: ''
  }
  
  macro = h[:macro]
  h2 = options.merge(filter(options,h).merge(macro: macro))

  super(h2)
  
  @label = 'If Confirmed Then '

end

Instance Method Details

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



333
334
335
336
337
338
# File 'lib/ruby-macrodroid/actions.rb', line 333

def to_s(colour: false, indent: 0)
  
  @s = "If Confirmed Then " #+ @constraints.map(&:to_s).join(" %s " % operator)
  super(colour: colour)
  
end