Class: GitMiner::GroupManager
- Inherits:
-
Object
- Object
- GitMiner::GroupManager
- Defined in:
- lib/git_miner/group_manager.rb
Instance Attribute Summary collapse
-
#author_offset ⇒ Object
readonly
Returns the value of attribute author_offset.
-
#batch ⇒ Object
readonly
Returns the value of attribute batch.
-
#batch_size ⇒ Object
readonly
Returns the value of attribute batch_size.
-
#committer_offset ⇒ Object
readonly
Returns the value of attribute committer_offset.
-
#count ⇒ Object
readonly
Returns the value of attribute count.
Instance Method Summary collapse
- #advance! ⇒ Object
-
#initialize(batch_size:) ⇒ GroupManager
constructor
A new instance of GroupManager.
Constructor Details
#initialize(batch_size:) ⇒ GroupManager
Returns a new instance of GroupManager.
5 6 7 8 9 10 11 12 |
# File 'lib/git_miner/group_manager.rb', line 5 def initialize(batch_size:) @batch_size = batch_size @author_offset = 0 @committer_offset = 0 @batch = 0 @count = 0 end |
Instance Attribute Details
#author_offset ⇒ Object (readonly)
Returns the value of attribute author_offset.
3 4 5 |
# File 'lib/git_miner/group_manager.rb', line 3 def @author_offset end |
#batch ⇒ Object (readonly)
Returns the value of attribute batch.
3 4 5 |
# File 'lib/git_miner/group_manager.rb', line 3 def batch @batch end |
#batch_size ⇒ Object (readonly)
Returns the value of attribute batch_size.
3 4 5 |
# File 'lib/git_miner/group_manager.rb', line 3 def batch_size @batch_size end |
#committer_offset ⇒ Object (readonly)
Returns the value of attribute committer_offset.
3 4 5 |
# File 'lib/git_miner/group_manager.rb', line 3 def committer_offset @committer_offset end |
#count ⇒ Object (readonly)
Returns the value of attribute count.
3 4 5 |
# File 'lib/git_miner/group_manager.rb', line 3 def count @count end |
Instance Method Details
#advance! ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/git_miner/group_manager.rb', line 14 def advance! @batch_size.times do @committer_offset += 1 if @committer_offset > @author_offset @author_offset += 1 @committer_offset = 0 end end @count += @batch_size @batch += 1 end |