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.
-
#noop ⇒ Mutation::Noop
private
Return noop mutation.
-
#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.
-
#source_line ⇒ Fixnum
private
Return source line.
-
#source_path ⇒ String
private
Return source path.
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
86 87 88 |
# File 'lib/mutant/subject.rb', line 86 def identification "#{matcher.identification}:#{source_path}:#{source_line}" end |
#noop ⇒ Mutation::Noop
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 noop mutation
55 56 57 |
# File 'lib/mutant/subject.rb', line 55 def noop Mutation::Noop.new(self) 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
120 121 122 |
# File 'lib/mutant/subject.rb', line 120 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
110 111 112 |
# File 'lib/mutant/subject.rb', line 110 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
97 98 99 |
# File 'lib/mutant/subject.rb', line 97 def source ToSource.to_source(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
76 77 78 |
# File 'lib/mutant/subject.rb', line 76 def source_line node.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
66 67 68 |
# File 'lib/mutant/subject.rb', line 66 def source_path context.source_path end |