Class: Evilution::Mutation
- Inherits:
-
Object
- Object
- Evilution::Mutation
show all
- Defined in:
- lib/evilution/mutation.rb
Defined Under Namespace
Classes: Location, Slice, Sources
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(subject:, operator_name:, sources:, location:, slice: nil, parse_status: :ok) ⇒ Mutation
Returns a new instance of Mutation.
13
14
15
16
17
18
19
20
21
|
# File 'lib/evilution/mutation.rb', line 13
def initialize(subject:, operator_name:, sources:, location:, slice: nil, parse_status: :ok)
@subject = subject
@operator_name = operator_name
@sources = sources
@location = location
@slice = slice
@parse_status = parse_status
@diff = nil
end
|
Instance Attribute Details
#location ⇒ Object
Returns the value of attribute location.
11
12
13
|
# File 'lib/evilution/mutation.rb', line 11
def location
@location
end
|
#operator_name ⇒ Object
Returns the value of attribute operator_name.
11
12
13
|
# File 'lib/evilution/mutation.rb', line 11
def operator_name
@operator_name
end
|
#parse_status ⇒ Object
Returns the value of attribute parse_status.
11
12
13
|
# File 'lib/evilution/mutation.rb', line 11
def parse_status
@parse_status
end
|
#subject ⇒ Object
Returns the value of attribute subject.
11
12
13
|
# File 'lib/evilution/mutation.rb', line 11
def subject
@subject
end
|
Instance Method Details
#column ⇒ Object
47
48
49
|
# File 'lib/evilution/mutation.rb', line 47
def column
@location.column
end
|
#diff ⇒ Object
55
56
57
|
# File 'lib/evilution/mutation.rb', line 55
def diff
@diff ||= compute_diff
end
|
#file_path ⇒ Object
39
40
41
|
# File 'lib/evilution/mutation.rb', line 39
def file_path
@location.file_path
end
|
#line ⇒ Object
43
44
45
|
# File 'lib/evilution/mutation.rb', line 43
def line
@location.line
end
|
#mutated_slice ⇒ Object
35
36
37
|
# File 'lib/evilution/mutation.rb', line 35
def mutated_slice
@slice&.mutated
end
|
#mutated_source ⇒ Object
27
28
29
|
# File 'lib/evilution/mutation.rb', line 27
def mutated_source
@sources&.mutated
end
|
#original_slice ⇒ Object
31
32
33
|
# File 'lib/evilution/mutation.rb', line 31
def original_slice
@slice&.original
end
|
#original_source ⇒ Object
23
24
25
|
# File 'lib/evilution/mutation.rb', line 23
def original_source
@sources&.original
end
|
#strip_sources! ⇒ Object
65
66
67
68
|
# File 'lib/evilution/mutation.rb', line 65
def strip_sources!
diff @sources = nil
end
|
#to_s ⇒ Object
70
71
72
|
# File 'lib/evilution/mutation.rb', line 70
def to_s
"#{operator_name}: #{file_path}:#{line}"
end
|
#unified_diff ⇒ Object
59
60
61
62
63
|
# File 'lib/evilution/mutation.rb', line 59
def unified_diff
return @unified_diff if defined?(@unified_diff)
@unified_diff = compute_unified_diff
end
|
#unparseable? ⇒ Boolean
51
52
53
|
# File 'lib/evilution/mutation.rb', line 51
def unparseable?
@parse_status == :unparseable
end
|