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

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

Overview

Mutator for memoized instance methods

Constant Summary

Constants included from NodeHelpers

NodeHelpers::INFINITY, NodeHelpers::NAN, NodeHelpers::NEGATIVE_INFINITY, NodeHelpers::N_EMPTY, NodeHelpers::N_FALSE, NodeHelpers::N_NIL, NodeHelpers::N_SELF, NodeHelpers::N_TRUE, NodeHelpers::RAISE

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

NAME_INDEX, SYMBOL

Instance Method Summary collapse

Methods included from NodeHelpers

#n_not, s

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

#public?

Methods inherited from Mutant::Subject::Method

#match_expression, #name, #public?

Methods inherited from Mutant::Subject

#identification, #match_expression, #match_prefixes, #mutations, #original_root, #root, #source_line, #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)


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

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)


56
57
58
# File 'lib/mutant/subject/method/instance.rb', line 56

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