Class: Mutant::Matcher::Namespace

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

Overview

Matcher for specific namespace

rubocop:disable LineLength

Instance Method Summary collapse

Methods inherited from Mutant::Matcher

build, #identification

Instance Method Details

#each(&block) ⇒ self, Enumerator<Subject>

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.

Enumerate subjects

Returns:

  • (self)

    if block given

  • (Enumerator<Subject>)

    otherwise



20
21
22
23
24
25
26
27
28
# File 'lib/mutant/matcher/namespace.rb', line 20

def each(&block)
  return to_enum unless block_given?

  env.matchable_scopes.select do |scope|
    scope.each(&block) if match?(scope)
  end

  self
end