Class: Lookout::Diff::Formats::Unified
- Includes:
- Enumerable
- Defined in:
- lib/lookout-3.0/diff/formats/unified.rb
Overview
Formats Groups in unified format. This format shows Groups of related operations, providing a script of changes to be made that is both human and computer readable. For more information, see http://en.wikipedia.org/wiki/Diff#Unified_format.
This format is used by Lookout::Difference::String for multi-line Strings.
Defined Under Namespace
Classes: ToS
Instance Method Summary collapse
- #each ⇒ Object
-
#to_s ⇒ Object
The concatenation of the formatted groups.
Instance Method Details
# {|string| ... } ⇒ Object # ⇒ Enumerator<String>
21 22 23 24 25 26 27 28 |
# File 'lib/lookout-3.0/diff/formats/unified.rb', line 21 def each return enum_for(__method__) unless block_given? groups.each do |group| next if group.parity? yield ToS.new(group).to_s end self end |
#to_s ⇒ Object
Returns The concatenation of the formatted groups.
31 |
# File 'lib/lookout-3.0/diff/formats/unified.rb', line 31 def to_s; to_a.join("\n") end |