class Datadog::Contrib::Configuration::Resolvers::PatternResolver
Matches Strings and Regexps against `object.to_s` objects and Procs against plain objects.
Public Instance Methods
resolve(value)
click to toggle source
# File lib/ddtrace/contrib/configuration/resolvers/pattern_resolver.rb, line 12 def resolve(value) return if configurations.empty? # Try to find a matching pattern _, config = configurations.reverse_each.find do |matcher, _| matcher === if matcher.is_a?(Proc) value else value.to_s end end config end
Protected Instance Methods
parse_matcher(matcher)
click to toggle source
# File lib/ddtrace/contrib/configuration/resolvers/pattern_resolver.rb, line 29 def parse_matcher(matcher) if matcher.is_a?(Regexp) || matcher.is_a?(Proc) matcher else matcher.to_s end end