Class: Mutant::Subject Private
- Inherits:
-
Object
- Object
- Mutant::Subject
- Includes:
- Enumerable, Unparser::AbstractType, Unparser::Adamantium
- Defined in:
- lib/mutant/subject.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
Classes: Method
Instance Method Summary collapse
-
#expression ⇒ Expression
private
Match expression.
-
#identification ⇒ String
private
Identification string.
-
#match_expressions ⇒ Enumerable<Expression>
private
Match expressions.
-
#mutations ⇒ Enumerable<Mutation>, undefined
private
Mutations for this subject.
-
#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
71 |
# File 'lib/mutant/subject.rb', line 71 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
55 56 57 |
# File 'lib/mutant/subject.rb', line 55 def identification "#{expression.syntax}:#{source_path}:#{source_line}" 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
76 |
# File 'lib/mutant/subject.rb', line 76 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
13 14 15 16 17 18 19 |
# File 'lib/mutant/subject.rb', line 13 def mutations [neutral_mutation].concat( Mutator.mutate(node).map do |mutant| Mutation::Evil.new(self, wrap_node(mutant)) end ) 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
32 33 34 |
# File 'lib/mutant/subject.rb', line 32 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
63 64 65 |
# File 'lib/mutant/subject.rb', line 63 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
48 49 50 |
# File 'lib/mutant/subject.rb', line 48 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
39 40 41 42 |
# File 'lib/mutant/subject.rb', line 39 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
25 26 27 |
# File 'lib/mutant/subject.rb', line 25 def source_path context.source_path end |