Class: Lookout::Diff::Formats::Set
- Includes:
- Enumerable
- Defined in:
- lib/lookout-3.0/diff/formats/set.rb
Overview
Formats Operations on an undordered set. Added subsequences are shown having each element prefixed by “+” and deleted subsequences by “-”. Replaced subsequences are shown as a deleted subsequence followed by an added subsequence.
This format is used by Lookout::Difference::Hash.
Defined Under Namespace
Classes: ToS
Instance Method Summary collapse
- #each ⇒ Object
-
#to_s ⇒ Object
The concatenation of the formatted operations.
Instance Method Details
# {|string| ... } ⇒ Object # ⇒ Enumerator<String>
21 22 23 24 25 26 27 28 |
# File 'lib/lookout-3.0/diff/formats/set.rb', line 21 def each return enum_for(__method__) unless block_given? operations.each do |op| operation = ToS.new(op) yield operation.to_s unless operation.empty? end self end |
#to_s ⇒ Object
Returns The concatenation of the formatted operations.
31 |
# File 'lib/lookout-3.0/diff/formats/set.rb', line 31 def to_s; to_a.join("\n") end |