Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Patch_obj initialize improved.

  • Loading branch information...
commit 0aa5e3b60c424a56596050d7a6ac089780fb7fcf 1 parent 4ba4e41
@suruja authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/patch_obj.rb
View
12 lib/patch_obj.rb
@@ -6,13 +6,13 @@ class PatchObj
attr_accessor :length1, :length2
attr_accessor :diffs
- def initialize
+ def initialize(args = {})
# Initializes with an empty list of diffs.
- @start1 = nil
- @start2 = nil
- @length1 = 0
- @length2 = 0
- @diffs = []
+ @start1 = args[:start1]
+ @start2 = args[:start2]
+ @length1 = args[:length1] || 0
+ @length2 = args[:length2] || 0
+ @diffs = args[:diffs] || []
end
# Emulate GNU diff's format
Please sign in to comment.
Something went wrong with that request. Please try again.