Class: CommitCommentTools::RepositoryStats::CommitGroup
- Inherits:
-
Object
- Object
- CommitCommentTools::RepositoryStats::CommitGroup
- Defined in:
- lib/commit-comment-tools/repository-stats.rb
Instance Attribute Summary collapse
-
#branch_name ⇒ Object
readonly
Returns the value of attribute branch_name.
-
#commits ⇒ Object
readonly
Returns the value of attribute commits.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
- #diff_bytesize ⇒ Object
- #diff_lines_count ⇒ Object
-
#initialize(branch_name, key, commits) ⇒ CommitGroup
constructor
A new instance of CommitGroup.
- #size ⇒ Object
Constructor Details
#initialize(branch_name, key, commits) ⇒ CommitGroup
Returns a new instance of CommitGroup.
31 32 33 34 35 |
# File 'lib/commit-comment-tools/repository-stats.rb', line 31 def initialize(branch_name, key, commits) @branch_name = branch_name @key = key @commits = commits end |
Instance Attribute Details
#branch_name ⇒ Object (readonly)
Returns the value of attribute branch_name.
29 30 31 |
# File 'lib/commit-comment-tools/repository-stats.rb', line 29 def branch_name @branch_name end |
#commits ⇒ Object (readonly)
Returns the value of attribute commits.
29 30 31 |
# File 'lib/commit-comment-tools/repository-stats.rb', line 29 def commits @commits end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
29 30 31 |
# File 'lib/commit-comment-tools/repository-stats.rb', line 29 def key @key end |
Instance Method Details
#diff_bytesize ⇒ Object
47 48 49 50 51 |
# File 'lib/commit-comment-tools/repository-stats.rb', line 47 def diff_bytesize @diff_bytesize ||= commits.inject(0) do |memo, commit| memo + commit.diff_bytesize end end |
#diff_lines_count ⇒ Object
41 42 43 44 45 |
# File 'lib/commit-comment-tools/repository-stats.rb', line 41 def diff_lines_count @diff_lines_count ||= commits.inject(0) do |memo, commit| memo + commit.diff_lines_count end end |
#size ⇒ Object
37 38 39 |
# File 'lib/commit-comment-tools/repository-stats.rb', line 37 def size @commits.size end |