Class: Mutant::Subject::Method

Inherits:
Mutant::Subject show all
Defined in:
lib/mutant/subject/method.rb,
lib/mutant/subject/method/instance.rb,
lib/mutant/subject/method/singleton.rb

Overview

Abstract base class for method subjects

Direct Known Subclasses

Instance, Singleton

Defined Under Namespace

Classes: Instance, Singleton

Instance Method Summary collapse

Methods inherited from Mutant::Subject

#identification, #match_prefixes, #mutations, #original_root, #root, #source, #source_line, #source_path

Instance Method Details

#match_expressionString

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 match expression

Returns:

  • (String)


36
37
38
# File 'lib/mutant/subject/method.rb', line 36

def match_expression
  "#{context.identification}#{self.class::SYMBOL}#{name}"
end

#nameSymbol

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 method name

Returns:

  • (Symbol)


26
27
28
# File 'lib/mutant/subject/method.rb', line 26

def name
  node.children[self.class::NAME_INDEX]
end

#public?true, false

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.

Test if method is public

Returns:

  • (true)

    if method is public

  • (false)

    otherwise



18
# File 'lib/mutant/subject/method.rb', line 18

abstract_method :public?