class Puppet::Util::MultiMatch

Constants

NOT_NIL
TRIPLE
TUPLE

Attributes

values[R]

Public Class Methods

new(*values) click to toggle source
   # File lib/puppet/util/multi_match.rb
20 def initialize(*values)
21   @values = values
22 end

Public Instance Methods

===(other) click to toggle source
   # File lib/puppet/util/multi_match.rb
24 def ===(other)
25   lv = @values  # local var is faster than instance var
26   case other
27   when MultiMatch
28     return false unless other.values.size == values.size
29     other.values.each_with_index {|v, i| return false unless lv[i] === v || v === lv[i]}
30   when Array
31     return false unless other.size == values.size
32     other.each_with_index {|v, i| return false unless lv[i] === v || v === lv[i]}
33   else
34     false
35   end
36   true
37 end