class MethodFound::Interceptor::Matcher

Public Instance Methods

inspect() click to toggle source
# File lib/method_found/interceptor.rb, line 87
def inspect
  matcher.inspect
end
match(method_name, context) click to toggle source
# File lib/method_found/interceptor.rb, line 73
def match(method_name, context)
  if matcher.is_a?(Regexp)
    matcher.match(method_name)
  elsif matcher.respond_to?(:call)
    context.instance_exec(method_name, &matcher)
  else
    (matcher.to_sym == method_name)
  end
end
proc?() click to toggle source
# File lib/method_found/interceptor.rb, line 83
def proc?
  matcher.is_a?(Proc)
end