lib/sub_diff/builder.rb in sub_diff-1.1.0 vs lib/sub_diff/builder.rb in sub_diff-1.1.1
- old
+ new
@@ -1,6 +1,12 @@
module SubDiff
+ # Performs a {Sub} or {Gsub} replacement and returns
+ # the resulting {Collection} of {Diff} objects.
+ #
+ # Used internally by {CoreExt::String#sub_diff} and {CoreExt::String#gsub_diff}.
+ #
+ # @api private
class Builder
attr_reader :string, :diff_method
def initialize(string, diff_method)
@string = string
@@ -30,10 +36,10 @@
def collection
@collection ||= Collection.new(string)
end
def adapter
- @adapter ||= Adapter.new(differ)
+ @adapter ||= Adapter.new(self)
end
def differ
@differ ||= Differ.new(self)
end