Sha256: e8ae6481aab3789f0db7e95bc9d7b137f6b7d2b11f27359b43879ce77d7e0778
Contents?: true
Size: 638 Bytes
Versions: 1
Compression:
Stored size: 638 Bytes
Contents
module SubDiff class Builder < Struct.new(:string, :type) def diff(*args, &block) builder.diff(*args, &block) collection end def push(*args) if args.compact.any? diff = Diff.new(*args) collection.push(diff) end end alias_method :<<, :push private def builder constant.new(differ) end def constant Module.nesting.last.const_get(constant_name) end def constant_name type.to_s.capitalize end def differ Differ.new(self, type) end def collection @collection ||= Collection.new(string) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sub_diff-1.0.2 | lib/sub_diff/builder.rb |