lib/sub_diff/collection.rb in sub_diff-1.1.0 vs lib/sub_diff/collection.rb in sub_diff-1.1.1
- old
+ new
@@ -1,5 +1,15 @@
module SubDiff
+ # Stores a collection of {Diff} objects for all matches from
+ # a {String#sub_diff} or {String#gsub_diff} replacement.
+ #
+ # It behaves like a {String} that represents the entire
+ # replacement result from {String#sub} or {String#gsub}.
+ #
+ # It also behaves like an {Enumerable} by delegating to
+ # {Collection#diffs} - an {Array} containing each {Diff}.
+ #
+ # @api public
class Collection < SimpleDelegator
extend Forwardable
include Enumerable
def_delegators :diffs, :each, :size