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.
-
#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
48 49 50 |
# File 'lib/mutant/subject.rb', line 48 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
93 |
# File 'lib/mutant/subject.rb', line 93 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
101 102 103 |
# File 'lib/mutant/subject.rb', line 101 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
82 83 84 |
# File 'lib/mutant/subject.rb', line 82 def original_root root(node) 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
72 73 74 |
# File 'lib/mutant/subject.rb', line 72 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
59 60 61 |
# File 'lib/mutant/subject.rb', line 59 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
38 39 40 |
# File 'lib/mutant/subject.rb', line 38 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 |