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
-
#identification ⇒ String
private
Return subject identification.
-
#match_expression ⇒ String
private
Return match expression.
-
#match_prefixes ⇒ Enumerable<String>
private
Return match prefixes.
-
#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
#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
58 59 60 |
# File 'lib/mutant/subject.rb', line 58 def identification "#{match_expression}:#{source_path}:#{source_line}" end |
#match_expression ⇒ 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 match expression
103 |
# File 'lib/mutant/subject.rb', line 103 abstract_method :match_expression |
#match_prefixes ⇒ Enumerable<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 match prefixes
111 112 113 |
# File 'lib/mutant/subject.rb', line 111 def match_prefixes [match_expression].concat(context.match_prefixes) 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
15 16 17 18 19 |
# File 'lib/mutant/subject.rb', line 15 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
92 93 94 |
# File 'lib/mutant/subject.rb', line 92 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
38 39 40 |
# File 'lib/mutant/subject.rb', line 38 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
82 83 84 |
# File 'lib/mutant/subject.rb', line 82 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
69 70 71 |
# File 'lib/mutant/subject.rb', line 69 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
48 49 50 |
# File 'lib/mutant/subject.rb', line 48 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
28 29 30 |
# File 'lib/mutant/subject.rb', line 28 def source_path context.source_path end |