Class: GitDiff::Diff

Inherits:
Object
  • Object
show all
Defined in:
lib/git_diff/diff.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDiff

Returns a new instance of Diff.



7
8
9
# File 'lib/git_diff/diff.rb', line 7

def initialize
  @files = []
end

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



5
6
7
# File 'lib/git_diff/diff.rb', line 5

def files
  @files
end

Instance Method Details

#<<(string) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/git_diff/diff.rb', line 11

def <<(string)
  if file = File.from_string(string)
    add_file file
  else
    append_to_current_file string
  end
end

#statsObject



19
20
21
# File 'lib/git_diff/diff.rb', line 19

def stats
  @stats ||= Stats.total(collector)
end