Class: TriggerThatInvokedConstraint

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

Overview

Category: MacroDroid Specific

Instance Attribute Summary

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Constraint

#match?

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ TriggerThatInvokedConstraint

Returns a new instance of TriggerThatInvokedConstraint.



4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
# File 'lib/ruby-macrodroid.rb', line 4725

def initialize(h={})

  puts ('h: ' + h.inspect).green
  @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))

end

Instance Method Details

#to_sObject



4740
4741
4742
# File 'lib/ruby-macrodroid.rb', line 4740

def to_s()
  'Trigger Fired: ' + @trigger.to_s
end