Class: Evilution::Reporter::Suggestion::DiffLines Private
- Inherits:
-
Object
- Object
- Evilution::Reporter::Suggestion::DiffLines
- Defined in:
- lib/evilution/reporter/suggestion/diff_lines.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #mutated ⇒ Object readonly private
- #original ⇒ Object readonly private
Class Method Summary collapse
- .from_diff(raw_diff) ⇒ Object private
Instance Method Summary collapse
-
#initialize(original:, mutated:) ⇒ DiffLines
constructor
private
A new instance of DiffLines.
Constructor Details
#initialize(original:, mutated:) ⇒ DiffLines
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.
Returns a new instance of DiffLines.
23 24 25 26 27 |
# File 'lib/evilution/reporter/suggestion/diff_lines.rb', line 23 def initialize(original:, mutated:) @original = original @mutated = mutated freeze end |
Instance Attribute Details
#mutated ⇒ Object (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.
21 22 23 |
# File 'lib/evilution/reporter/suggestion/diff_lines.rb', line 21 def mutated @mutated end |
#original ⇒ Object (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.
21 22 23 |
# File 'lib/evilution/reporter/suggestion/diff_lines.rb', line 21 def original @original end |
Class Method Details
.from_diff(raw_diff) ⇒ Object
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.
6 7 8 9 10 11 12 |
# File 'lib/evilution/reporter/suggestion/diff_lines.rb', line 6 def self.from_diff(raw_diff) lines = raw_diff.split("\n") new( original: clean(lines.find { |l| l.start_with?("- ") }, "- "), mutated: clean(lines.find { |l| l.start_with?("+ ") }, "+ ") ) end |