Class: SubDiff::Sub

Inherits:
Struct
  • Object
show all
Defined in:
lib/sub_diff/sub.rb

Direct Known Subclasses

Gsub

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#differObject

Returns the value of attribute differ

Returns:

  • (Object)

    the current value of differ



2
3
4
# File 'lib/sub_diff/sub.rb', line 2

def differ
  @differ
end

Instance Method Details

#diff(*args, &block) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/sub_diff/sub.rb', line 3

def diff(*args, &block)
  # Ruby 1.8.7 does not support additional args after * (splat)
  args.push(block)

  differ.diff(*args) do |builder, diff|
    diff!(builder, diff, args.first)
  end
end