Class: Grit::DiffStat
- Inherits:
-
Object
- Object
- Grit::DiffStat
- Defined in:
- lib/grit/commit_stats.rb
Overview
CommitStats
Instance Attribute Summary collapse
-
#additions ⇒ Object
readonly
Returns the value of attribute additions.
-
#deletions ⇒ Object
readonly
Returns the value of attribute deletions.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
-
#initialize(filename, additions, deletions, total = nil) ⇒ DiffStat
constructor
A new instance of DiffStat.
- #inspect ⇒ Object
- #net ⇒ Object
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
#additions ⇒ Object (readonly)
Returns the value of attribute additions.
113 114 115 |
# File 'lib/grit/commit_stats.rb', line 113 def additions @additions end |
#deletions ⇒ Object (readonly)
Returns the value of attribute deletions.
113 114 115 |
# File 'lib/grit/commit_stats.rb', line 113 def deletions @deletions end |
#filename ⇒ Object (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
#inspect ⇒ Object
123 124 125 |
# File 'lib/grit/commit_stats.rb', line 123 def inspect "#{filename}: +#{additions} -#{deletions}" end |
#net ⇒ Object
119 120 121 |
# File 'lib/grit/commit_stats.rb', line 119 def net additions - deletions end |