Welcome to mirror list, hosted at ThFree Co, Russian Federation.

container_tags_serializer.rb « serializers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 982ce33f6e33a362e2d3e30abe404a28057b20ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class ContainerTagsSerializer < BaseSerializer
  entity ContainerTagEntity

  def with_pagination(request, response)
    tap { @paginator = Gitlab::Serializer::Pagination.new(request, response) }
  end

  def paginated?
    @paginator.present?
  end

  def represent(resource, opts = {})
    resource = @paginator.paginate(resource) if paginated?

    super(resource, opts)
  end
end