Class: Constraint

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, #to_s

Constructor Details

#initialize(h = {}) ⇒ Constraint

Returns a new instance of Constraint.



3960
3961
3962
# File 'lib/ruby-macrodroid.rb', line 3960

def initialize(h={})    
  super(h)
end

Instance Method Details

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

Returns:

  • (Boolean)


3964
3965
3966
3967
3968
# File 'lib/ruby-macrodroid.rb', line 3964

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

  detail.select {|k,v| @h.include? k }.all? {|key,value| @h[key] == value}

end