Class: Constraint

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

Instance Attribute Summary

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from MacroObject

#to_h, #to_s

Constructor Details

#initialize(h = {}) ⇒ Constraint

Returns a new instance of Constraint.



4742
4743
4744
# File 'lib/ruby-macrodroid.rb', line 4742

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

Instance Method Details

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

Returns:

  • (Boolean)


4746
4747
4748
4749
4750
# File 'lib/ruby-macrodroid.rb', line 4746

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

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

end