Method: Puppet::Util::Log::Destination.match?

Defined in:
lib/vendor/puppet/util/log/destination.rb

.match?(obj) ⇒ Boolean

See whether we match a given thing.

Returns:



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/vendor/puppet/util/log/destination.rb', line 18

def self.match?(obj)
  # Convert single-word strings into symbols like :console and :syslog
  if obj.is_a? String and obj =~ /^\w+$/
    obj = obj.downcase.intern
  end

  @matches.each do |thing|
    # Search for direct matches or class matches
    return true if thing === obj or thing == obj.class.to_s
  end
  false
end