Class: GitStats::GitData::ShortStat

Inherits:
Object
  • Object
show all
Defined in:
lib/git_stats/git_data/short_stat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(commit) ⇒ ShortStat

Returns a new instance of ShortStat.



6
7
8
9
# File 'lib/git_stats/git_data/short_stat.rb', line 6

def initialize(commit)
  @commit = commit
  calculate_stat
end

Instance Attribute Details

#commitObject (readonly)

Returns the value of attribute commit.



4
5
6
# File 'lib/git_stats/git_data/short_stat.rb', line 4

def commit
  @commit
end

#deletionsObject (readonly)

Returns the value of attribute deletions.



4
5
6
# File 'lib/git_stats/git_data/short_stat.rb', line 4

def deletions
  @deletions
end

#files_changedObject (readonly)

Returns the value of attribute files_changed.



4
5
6
# File 'lib/git_stats/git_data/short_stat.rb', line 4

def files_changed
  @files_changed
end

#insertionsObject (readonly)

Returns the value of attribute insertions.



4
5
6
# File 'lib/git_stats/git_data/short_stat.rb', line 4

def insertions
  @insertions
end

Instance Method Details

#changed_linesObject



11
12
13
# File 'lib/git_stats/git_data/short_stat.rb', line 11

def changed_lines
  insertions + deletions
end