class TriggerThatInvokedConstraint

Category: MacroDroid Specific

Public Class Methods

new(h={}) click to toggle source
Calls superclass method Constraint::new
# File lib/ruby-macrodroid/constraints.rb, line 920
def initialize(h={})

  puts ('h: ' + h.inspect).green if $debug
  @trigger = h[:macro].triggers.find {|x| x.siguid == h[:si_guid_that_invoked] }
  
  options = {
    not: false,
    si_guid_that_invoked: -4951291100076165433,
    trigger_name: 'Shake Device'
  }

  #super(options.merge filter(options,h))
  super(options.merge h)

end

Public Instance Methods

to_s(colour: false, indent: 0) click to toggle source
# File lib/ruby-macrodroid/constraints.rb, line 936
def to_s(colour: false, indent: 0)
  'Trigger Fired: ' + @trigger.to_s(colour: colour)
end
to_summary(colour: false) click to toggle source
# File lib/ruby-macrodroid/constraints.rb, line 940
def to_summary(colour: false)
  #puts '@trigger' + @trigger.inspect
  if @trigger then
    'Trigger Fired: ' + @trigger.to_summary(colour: colour)
  else
    'Trigger Fired: Trigger not found; guid: ' + @h[:si_guid_that_invoked].inspect
  end
end