Class: Mutant::Subject
- Inherits:
-
Object
- Object
- Mutant::Subject
- Includes:
- AbstractType, Adamantium::Flat, Enumerable
- Defined in:
- lib/mutant/subject.rb,
lib/mutant/subject/method.rb,
lib/mutant/subject/method/instance.rb,
lib/mutant/subject/method/singleton.rb
Overview
Subject of a mutation
Direct Known Subclasses
Defined Under Namespace
Classes: Method
Instance Method Summary collapse
-
#expression ⇒ Expression
private
Return match expression.
-
#identification ⇒ String
private
Return subject identification.
-
#match_expressions ⇒ Enumerable<Expression>
private
Return match expressions.
-
#mutations ⇒ Enumerable<Mutation>
private
Return mutations.
-
#original_root ⇒ Parser::AST::Node
private
Return root AST node for original AST ndoe.
-
#prepare ⇒ self
private
Prepare the subject for the insertion of mutation.
-
#root(node) ⇒ Parser::AST::Node
private
Return root AST for node.
-
#source ⇒ String
private
Return source representation of ast.
-
#source_line ⇒ Fixnum
private
Return source line.
-
#source_path ⇒ String
private
Return 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.
Return match expression
101 |
# File 'lib/mutant/subject.rb', line 101 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.
Return subject identification
56 57 58 |
# File 'lib/mutant/subject.rb', line 56 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.
Return match expressions
109 110 111 |
# File 'lib/mutant/subject.rb', line 109 def match_expressions [expression].concat(context.match_expressions) end |
#mutations ⇒ Enumerable<Mutation>
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 mutations
13 14 15 16 17 |
# File 'lib/mutant/subject.rb', line 13 def mutations mutations = [] generate_mutations(mutations) mutations end |
#original_root ⇒ Parser::AST::Node
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 root AST node for original AST ndoe
90 91 92 |
# File 'lib/mutant/subject.rb', line 90 def original_root root(node) 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 the subject for the insertion of mutation
36 37 38 |
# File 'lib/mutant/subject.rb', line 36 def prepare self end |
#root(node) ⇒ Parser::AST::Node
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 root AST for node
80 81 82 |
# File 'lib/mutant/subject.rb', line 80 def root(node) context.root(node) 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.
Return source representation of ast
67 68 69 |
# File 'lib/mutant/subject.rb', line 67 def source Unparser.unparse(node) end |
#source_line ⇒ Fixnum
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 line
46 47 48 |
# File 'lib/mutant/subject.rb', line 46 def source_line node.location.expression.line end |
#source_path ⇒ 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.
Return source path
26 27 28 |
# File 'lib/mutant/subject.rb', line 26 def source_path context.source_path end |