Class: Trigger

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

Instance Attribute Summary

Attributes inherited from MacroObject

#options, #type

Instance Method Summary collapse

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ Trigger



587
588
589
590
# File 'lib/ruby-macrodroid.rb', line 587

def initialize(h={})    
  super({fakeIcon: 0}.merge(h))
  @list << 'fakeIcon'
end

Instance Method Details

#match?(detail = {}, model = nil) ⇒ Boolean



592
593
594
595
596
597
# File 'lib/ruby-macrodroid.rb', line 592

def match?(detail={}, model=nil)

  # only match where the key exists in the trigger object
  detail.select {|k,v| @h.include? k }.all? {|key,value| @h[key] == value}

end