Class: Diffy::SplitDiff
- Inherits:
-
Object
- Object
- Diffy::SplitDiff
- Defined in:
- lib/diffy/split_diff.rb
Instance Method Summary collapse
-
#initialize(left, right, options = {}) ⇒ SplitDiff
constructor
A new instance of SplitDiff.
Constructor Details
#initialize(left, right, options = {}) ⇒ SplitDiff
Returns a new instance of SplitDiff.
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/diffy/split_diff.rb', line 3 def initialize(left, right, = {}) @format = [:format] || Diffy::Diff.default_format formats = Format.instance_methods(false).map { |x| x.to_s } unless formats.include?(@format.to_s) fail ArgumentError, "Format #{format.inspect} is not a valid format" end @diff = Diffy::Diff.new(left, right, ).to_s(@format) @left_diff, @right_diff = split end |