Class: Gitlab::GitalyClient::CommitCollectionWithNextCursor
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Gitlab::GitalyClient::CommitCollectionWithNextCursor
- Defined in:
- lib/gitlab/gitaly_client/commit_collection_with_next_cursor.rb
Instance Attribute Summary collapse
-
#next_cursor ⇒ Object
readonly
Returns the value of attribute next_cursor.
Instance Method Summary collapse
-
#initialize(response, repository) ⇒ CommitCollectionWithNextCursor
constructor
A new instance of CommitCollectionWithNextCursor.
Constructor Details
#initialize(response, repository) ⇒ CommitCollectionWithNextCursor
Returns a new instance of CommitCollectionWithNextCursor.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/gitlab/gitaly_client/commit_collection_with_next_cursor.rb', line 6 def initialize(response, repository) commits = response.flat_map.with_index do |, index| @next_cursor = .pagination_cursor&.next_cursor if index == 0 .commits.map do |gitaly_commit| Gitlab::Git::Commit.new(repository, gitaly_commit) end end super(commits) end |
Instance Attribute Details
#next_cursor ⇒ Object (readonly)
Returns the value of attribute next_cursor.
18 19 20 |
# File 'lib/gitlab/gitaly_client/commit_collection_with_next_cursor.rb', line 18 def next_cursor @next_cursor end |