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
21 def initialize(*values)
22   @values = values
23 end

Public Instance Methods

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