Class: Mutant::Subject
- Inherits:
-
Object
- Object
- Mutant::Subject
- Includes:
- Adamantium::Flat, Enumerable
- Defined in:
- lib/mutant/subject.rb
Overview
Subject of a mutation
Instance Attribute Summary collapse
-
#context ⇒ Context
readonly
private
Return context.
-
#matcher ⇒ Matcher
readonly
private
Return matcher.
-
#node ⇒ Rubinius::AST::Node
readonly
private
Return AST node.
Instance Method Summary collapse
-
#each ⇒ self, Enumerator<Mutation>
private
Enumerate possible mutations.
-
#identification ⇒ String
private
Return subject identicication.
-
#original_root ⇒ Rubinius::AST::Node
private
Return root AST node for original AST ndoe.
-
#root(node) ⇒ Rubinius::AST::Node
private
Return root AST for node.
-
#source ⇒ Source
private
Return source representation of ast.
Instance Attribute Details
#context ⇒ Context (readonly)
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 context
12 13 14 |
# File 'lib/mutant/subject.rb', line 12 def context @context end |
#matcher ⇒ Matcher (readonly)
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 matcher
20 21 22 |
# File 'lib/mutant/subject.rb', line 20 def matcher @matcher end |
#node ⇒ Rubinius::AST::Node (readonly)
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 AST node
28 29 30 |
# File 'lib/mutant/subject.rb', line 28 def node @node end |
Instance Method Details
#each ⇒ self, Enumerator<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.
Enumerate possible mutations
40 41 42 43 44 45 46 47 |
# File 'lib/mutant/subject.rb', line 40 def each return to_enum unless block_given? Mutator.each(node) do |mutant| yield Mutation.new(self, mutant) end self end |
#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 identicication
55 56 57 58 59 |
# File 'lib/mutant/subject.rb', line 55 def identification source_path = context.source_path source_line = node.line "#{matcher.identification}:#{source_path}:#{source_line}" end |
#original_root ⇒ Rubinius::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
91 92 93 |
# File 'lib/mutant/subject.rb', line 91 def original_root root(node) end |
#root(node) ⇒ Rubinius::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
81 82 83 |
# File 'lib/mutant/subject.rb', line 81 def root(node) context.root(node) end |
#source ⇒ Source
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
68 69 70 |
# File 'lib/mutant/subject.rb', line 68 def source ToSource.to_source(node) end |