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.



3611
3612
3613
# File 'lib/ruby-macrodroid.rb', line 3611

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

Instance Method Details

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

Returns:

  • (Boolean)


3615
3616
3617
3618
3619
# File 'lib/ruby-macrodroid.rb', line 3615

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

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

end