Method: Puppet::Util::MultiMatch#===

Defined in:
lib/puppet/util/multi_match.rb

#===(other) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/puppet/util/multi_match.rb', line 24

def ===(other)
  lv = @values  # local var is faster than instance var
  case other
  when MultiMatch
    return false unless other.values.size == values.size
    other.values.each_with_index {|v, i| return false unless lv[i] === v || v === lv[i]}
  when Array
    return false unless other.size == values.size
    other.each_with_index {|v, i| return false unless lv[i] === v || v === lv[i]}
  else
    false
  end
  true
end