Class: Mutant::Matcher::Scope

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

Overview

Matcher for specific namespace

Constant Summary collapse

MATCHERS =
[
  Matcher::Methods::Singleton,
  Matcher::Methods::Instance
].freeze

Instance Method Summary collapse

Methods inherited from Mutant::Matcher

build

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



33
34
35
36
37
38
39
40
41
# File 'lib/mutant/matcher/scope.rb', line 33

def each(&block)
  return to_enum unless block_given?

  MATCHERS.each do |matcher|
    matcher.new(env, scope).each(&block)
  end

  self
end

#identificationString

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.

Return identification

Returns:

  • (String)


18
19
20
# File 'lib/mutant/matcher/scope.rb', line 18

def identification
  scope.name
end