Class: Evilution::Mutation
- Inherits:
-
Object
- Object
- Evilution::Mutation
- Defined in:
- lib/evilution/mutation.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#mutated_source ⇒ Object
readonly
Returns the value of attribute mutated_source.
-
#operator_name ⇒ Object
readonly
Returns the value of attribute operator_name.
-
#original_source ⇒ Object
readonly
Returns the value of attribute original_source.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Instance Method Summary collapse
- #diff ⇒ Object
-
#initialize(subject:, operator_name:, original_source:, mutated_source:, file_path:, line:, column: 0) ⇒ Mutation
constructor
A new instance of Mutation.
- #strip_sources! ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(subject:, operator_name:, original_source:, mutated_source:, file_path:, line:, column: 0) ⇒ Mutation
Returns a new instance of Mutation.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/evilution/mutation.rb', line 10 def initialize(subject:, operator_name:, original_source:, mutated_source:, file_path:, line:, column: 0) @subject = subject @operator_name = operator_name @original_source = original_source @mutated_source = mutated_source @file_path = file_path @line = line @column = column @diff = nil end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
7 8 9 |
# File 'lib/evilution/mutation.rb', line 7 def column @column end |
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
7 8 9 |
# File 'lib/evilution/mutation.rb', line 7 def file_path @file_path end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
7 8 9 |
# File 'lib/evilution/mutation.rb', line 7 def line @line end |
#mutated_source ⇒ Object (readonly)
Returns the value of attribute mutated_source.
7 8 9 |
# File 'lib/evilution/mutation.rb', line 7 def mutated_source @mutated_source end |
#operator_name ⇒ Object (readonly)
Returns the value of attribute operator_name.
7 8 9 |
# File 'lib/evilution/mutation.rb', line 7 def operator_name @operator_name end |
#original_source ⇒ Object (readonly)
Returns the value of attribute original_source.
7 8 9 |
# File 'lib/evilution/mutation.rb', line 7 def original_source @original_source end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
7 8 9 |
# File 'lib/evilution/mutation.rb', line 7 def subject @subject end |
Instance Method Details
#diff ⇒ Object
21 22 23 |
# File 'lib/evilution/mutation.rb', line 21 def diff @diff ||= compute_diff end |
#strip_sources! ⇒ Object
25 26 27 28 29 |
# File 'lib/evilution/mutation.rb', line 25 def strip_sources! diff # ensure diff is cached before clearing sources @original_source = nil @mutated_source = nil end |
#to_s ⇒ Object
54 55 56 |
# File 'lib/evilution/mutation.rb', line 54 def to_s "#{operator_name}: #{file_path}:#{line}" end |