Class: Mutant::Matcher::Descendants Private

Inherits:
Mutant::Matcher show all
Defined in:
lib/mutant/matcher/descendants.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Matcher for all descendants by constant name

Instance Method Summary collapse

Methods inherited from Mutant::Matcher

expand

Instance Method Details

#call(env) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
12
13
14
15
# File 'lib/mutant/matcher/descendants.rb', line 9

def call(env)
  const = env.world.try_const_get(const_name) or return EMPTY_ARRAY

  Chain.new(
    matchers: matched_scopes(env, const).map { |scope| Scope.new(scope:) }
  ).call(env)
end