Class: Mutant::Subject Private
- Inherits:
-
Object
- Object
- Mutant::Subject
- Includes:
- Enumerable, Unparser::AbstractType, Unparser::Adamantium
- Defined in:
- lib/mutant/subject.rb,
lib/mutant/subject/config.rb,
lib/mutant/subject/method.rb,
lib/mutant/subject/method/instance.rb,
lib/mutant/subject/method/metaclass.rb,
lib/mutant/subject/method/singleton.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Subject of a mutation
Direct Known Subclasses
Defined Under Namespace
Instance Method Summary collapse
-
#expression ⇒ Expression
private
Match expression.
-
#identification ⇒ String
private
Identification string.
- #inline_disabled? ⇒ Boolean private
-
#match_expressions ⇒ Enumerable<Expression>
private
Match expressions.
-
#mutations ⇒ Enumerable<Mutation>, undefined
private
Mutations for this subject.
-
#post_insert ⇒ self
private
Perform post insert cleanup.
-
#prepare ⇒ self
private
Prepare subject for insertion of mutation.
-
#source ⇒ String
private
Source representation of AST.
-
#source_line ⇒ Integer
private
First source line.
-
#source_lines ⇒ Range<Integer>
private
Source line range.
-
#source_path ⇒ Pathname
private
Source path.
Instance Method Details
#expression ⇒ Expression
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.
Match expression
93 |
# File 'lib/mutant/subject.rb', line 93 abstract_method :expression |
#identification ⇒ String
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.
Identification string
77 78 79 |
# File 'lib/mutant/subject.rb', line 77 def identification "#{expression.syntax}:#{source_path}:#{source_line}" end |
#inline_disabled? ⇒ 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.
33 34 35 |
# File 'lib/mutant/subject.rb', line 33 def inline_disabled? config.inline_disable end |
#match_expressions ⇒ Enumerable<Expression>
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.
Match expressions
98 |
# File 'lib/mutant/subject.rb', line 98 abstract_method :match_expressions |
#mutations ⇒ Enumerable<Mutation>, undefined
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.
Mutations for this subject
mutant:disable rubocop:disable Metrics/MethodLength
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/mutant/subject.rb', line 16 def mutations [neutral_mutation].concat( Mutator::Node.mutate( config: config.mutation, node: ).each_with_object([]) do |mutant, aggregate| Mutation::Evil .from_node(subject: self, node: wrap_node(mutant)) .either( ->(validation) {}, aggregate.public_method(:<<) ) end ) end |
#post_insert ⇒ self
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.
Perform post insert cleanup
54 55 56 |
# File 'lib/mutant/subject.rb', line 54 def post_insert self end |
#prepare ⇒ self
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 insertion of mutation
47 48 49 |
# File 'lib/mutant/subject.rb', line 47 def prepare self end |
#source ⇒ String
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.
Source representation of AST
85 86 87 |
# File 'lib/mutant/subject.rb', line 85 def source Unparser.unparse(wrap_node(node)) end |
#source_line ⇒ Integer
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.
First source line
70 71 72 |
# File 'lib/mutant/subject.rb', line 70 def source_line source_lines.begin end |
#source_lines ⇒ Range<Integer>
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.
Source line range
61 62 63 64 |
# File 'lib/mutant/subject.rb', line 61 def source_lines expression = node.location.expression expression.line..expression.source_buffer.decompose_position(expression.end_pos).first end |
#source_path ⇒ Pathname
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.
Source path
40 41 42 |
# File 'lib/mutant/subject.rb', line 40 def source_path context.source_path end |