Class: Mutant::Subject::Method::Instance

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

Overview

Instance method subjects

Direct Known Subclasses

Memoized

Defined Under Namespace

Classes: Memoized

Constant Summary collapse

NAME_INDEX =
0
SYMBOL =
'#'.freeze

Instance Method Summary collapse

Methods inherited from Mutant::Subject::Method

#expression, #match_expressions, #name

Methods inherited from Mutant::Subject

#expression, #identification, #match_expressions, #mutations, #source, #source_line, #source_lines, #source_path

Instance Method Details

#prepareself

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.

Prepare subject for mutation insertion

Returns:

  • (self)


27
28
29
30
# File 'lib/mutant/subject/method/instance.rb', line 27

def prepare
  scope.__send__(:undef_method, name)
  self
end

#public?Boolean

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:

  • (Boolean)


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

def public?
  scope.public_method_defined?(name)
end