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

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

Overview

Mutator for memoized instance methods

Constant Summary

Constants inherited from Mutant::Subject::Method::Instance

NAME_INDEX, SYMBOL, WARN_METHODS_UNDEFINED

Instance Method Summary collapse

Methods inherited from Mutant::Subject::Method::Instance

#public?

Methods inherited from Mutant::Subject::Method

#expression, #name, #public?

Methods inherited from Mutant::Subject

#expression, #identification, #match_expressions, #mutations, #root, #source_line, #source_path, #tests

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)


69
70
71
72
73
# File 'lib/mutant/subject/method/instance.rb', line 69

def prepare
  scope.send(:memoized_methods).instance_variable_get(:@memory).delete(name)
  super
  self
end

#sourceString

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 source

Returns:

  • (String)


58
59
60
# File 'lib/mutant/subject/method/instance.rb', line 58

def source
  Unparser.unparse(memoizer_node(node))
end