Class: TriggerThatInvokedConstraint
- Inherits:
-
Constraint
- Object
- MacroObject
- Constraint
- TriggerThatInvokedConstraint
- Defined in:
- lib/ruby-macrodroid/constraints.rb
Overview
Category: MacroDroid Specific
Instance Attribute Summary
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ TriggerThatInvokedConstraint
constructor
A new instance of TriggerThatInvokedConstraint.
- #to_s(colour: false, indent: 0) ⇒ Object
- #to_summary(colour: false) ⇒ Object
Methods inherited from Constraint
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ TriggerThatInvokedConstraint
Returns a new instance of TriggerThatInvokedConstraint.
912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 |
# File 'lib/ruby-macrodroid/constraints.rb', line 912 def initialize(h={}) puts ('h: ' + h.inspect).green if $debug @trigger = h[:macro].triggers.find {|x| x.siguid == h[:si_guid_that_invoked] } = { not: false, si_guid_that_invoked: -4951291100076165433, trigger_name: 'Shake Device' } #super(options.merge filter(options,h)) super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object
928 929 930 |
# File 'lib/ruby-macrodroid/constraints.rb', line 928 def to_s(colour: false, indent: 0) 'Trigger Fired: ' + @trigger.to_s(colour: colour) end |
#to_summary(colour: false) ⇒ Object
932 933 934 935 936 937 938 939 |
# File 'lib/ruby-macrodroid/constraints.rb', line 932 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 |