diff --git a/lib/mutant/expression/method.rb b/lib/mutant/expression/method.rb index a0963c57..900c0d7a 100644 --- a/lib/mutant/expression/method.rb +++ b/lib/mutant/expression/method.rb @@ -15,18 +15,18 @@ module Mutant # Return method matcher # - # @param [Cache] cache + # @param [Env] env # # @return [Matcher::Method] # # @api private # - def matcher(cache) - methods_matcher = MATCHERS.fetch(scope_symbol).new(cache, scope) + def matcher(env) + methods_matcher = MATCHERS.fetch(scope_symbol).new(env, scope) method = methods_matcher.methods.detect do |meth| meth.name.equal?(method_name) end or raise NameError, "Cannot find method #{identifier}" - methods_matcher.matcher.build(cache, scope, method) + methods_matcher.matcher.build(env, scope, method) end private @@ -71,16 +71,6 @@ module Mutant match[__method__] 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 # Expression end # Mutant diff --git a/lib/mutant/expression/methods.rb b/lib/mutant/expression/methods.rb index 8bfe27ed..70c7f1e2 100644 --- a/lib/mutant/expression/methods.rb +++ b/lib/mutant/expression/methods.rb @@ -15,14 +15,14 @@ module Mutant # Return method matcher # - # @param [Cache] cache + # @param [Env] env # # @return [Matcher::Method] # # @api private # - def matcher(cache) - MATCHERS.fetch(scope_symbol).new(cache, scope) + def matcher(env) + MATCHERS.fetch(scope_symbol).new(env, scope) end private diff --git a/lib/mutant/expression/namespace.rb b/lib/mutant/expression/namespace.rb index 1b0eadc0..828d9de7 100644 --- a/lib/mutant/expression/namespace.rb +++ b/lib/mutant/expression/namespace.rb @@ -26,14 +26,14 @@ module Mutant # Return matcher # - # @param [Cache] cache + # @param [Env] env # # @return [Matcher] # # @api private # - def matcher(cache) - Matcher::Namespace.new(cache, self) + def matcher(env) + Matcher::Namespace.new(env, self) end # Return length of match @@ -75,14 +75,14 @@ module Mutant # Return matcher # - # @param [Cache] cache + # @param [Cache] env # # @return [Matcher] # # @api private # - def matcher(cache) - Matcher::Scope.new(cache, Mutant.constant_lookup(namespace), self) + def matcher(env) + Matcher::Scope.new(env, Mutant.constant_lookup(namespace), self) end private