Nuke dead code and clean up naming

This commit is contained in:
Markus Schirp 2014-07-06 02:44:55 +00:00
parent ad972bcc00
commit 4213789903
3 changed files with 13 additions and 23 deletions

View file

@ -15,18 +15,18 @@ module Mutant
# Return method matcher # Return method matcher
# #
# @param [Cache] cache # @param [Env] env
# #
# @return [Matcher::Method] # @return [Matcher::Method]
# #
# @api private # @api private
# #
def matcher(cache) def matcher(env)
methods_matcher = MATCHERS.fetch(scope_symbol).new(cache, scope) methods_matcher = MATCHERS.fetch(scope_symbol).new(env, scope)
method = methods_matcher.methods.detect do |meth| method = methods_matcher.methods.detect do |meth|
meth.name.equal?(method_name) meth.name.equal?(method_name)
end or raise NameError, "Cannot find method #{identifier}" end or raise NameError, "Cannot find method #{identifier}"
methods_matcher.matcher.build(cache, scope, method) methods_matcher.matcher.build(env, scope, method)
end end
private private
@ -71,16 +71,6 @@ module Mutant
match[__method__] match[__method__]
end end
# Return matcher class
#
# @return [Class:Mutant::Matcher]
#
# @api private
#
def methods_matcher(cache)
MATCHERS.fetch(scope_symbol).new(cache, scope)
end
end # Method end # Method
end # Expression end # Expression
end # Mutant end # Mutant

View file

@ -15,14 +15,14 @@ module Mutant
# Return method matcher # Return method matcher
# #
# @param [Cache] cache # @param [Env] env
# #
# @return [Matcher::Method] # @return [Matcher::Method]
# #
# @api private # @api private
# #
def matcher(cache) def matcher(env)
MATCHERS.fetch(scope_symbol).new(cache, scope) MATCHERS.fetch(scope_symbol).new(env, scope)
end end
private private

View file

@ -26,14 +26,14 @@ module Mutant
# Return matcher # Return matcher
# #
# @param [Cache] cache # @param [Env] env
# #
# @return [Matcher] # @return [Matcher]
# #
# @api private # @api private
# #
def matcher(cache) def matcher(env)
Matcher::Namespace.new(cache, self) Matcher::Namespace.new(env, self)
end end
# Return length of match # Return length of match
@ -75,14 +75,14 @@ module Mutant
# Return matcher # Return matcher
# #
# @param [Cache] cache # @param [Cache] env
# #
# @return [Matcher] # @return [Matcher]
# #
# @api private # @api private
# #
def matcher(cache) def matcher(env)
Matcher::Scope.new(cache, Mutant.constant_lookup(namespace), self) Matcher::Scope.new(env, Mutant.constant_lookup(namespace), self)
end end
private private