Class: Grit::DiffStat

Inherits:
Object
  • Object
show all
Defined in:
lib/grit/commit_stats.rb

Overview

CommitStats

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, additions, deletions, total = nil) ⇒ DiffStat

Returns a new instance of DiffStat


115
116
117
# File 'lib/grit/commit_stats.rb', line 115

def initialize(filename, additions, deletions, total=nil)
  @filename, @additions, @deletions = filename, additions, deletions
end

Instance Attribute Details

#additionsObject (readonly)

Returns the value of attribute additions


113
114
115
# File 'lib/grit/commit_stats.rb', line 113

def additions
  @additions
end

#deletionsObject (readonly)

Returns the value of attribute deletions


113
114
115
# File 'lib/grit/commit_stats.rb', line 113

def deletions
  @deletions
end

#filenameObject (readonly)

Returns the value of attribute filename


113
114
115
# File 'lib/grit/commit_stats.rb', line 113

def filename
  @filename
end

Instance Method Details

#inspectObject


123
124
125
# File 'lib/grit/commit_stats.rb', line 123

def inspect
  "#{filename}: +#{additions} -#{deletions}"
end

#netObject


119
120
121
# File 'lib/grit/commit_stats.rb', line 119

def net
  additions - deletions
end