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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-06 16:47:56 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-06 16:47:56 +0300
commit81eb5c7fd79897d63e733e99b8fc4424dc8ea38a (patch)
tree7394e22be3d6237a74e4cef2434a28c84620c4fe /lib/gitlab/serializer
parent10c1a4d8e4828992afa56bfca6b61eeb328d851e (diff)
Move serializers pagination class to separate module
This helps to avoid conflicts with `Paginator` class that seems to be used by some bundled libs.
Diffstat (limited to 'lib/gitlab/serializer')
-rw-r--r--lib/gitlab/serializer/pagination.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/gitlab/serializer/pagination.rb b/lib/gitlab/serializer/pagination.rb
new file mode 100644
index 00000000000..d9372f3dcd6
--- /dev/null
+++ b/lib/gitlab/serializer/pagination.rb
@@ -0,0 +1,27 @@
+module Gitlab
+ module Serializer
+ class Pagination
+ include ::API::Helpers::Pagination
+
+ def initialize(request, response)
+ @request = request
+ @response = response
+ end
+
+ private
+
+ # Methods needed by `API::Helpers::Pagination`
+ #
+
+ attr_reader :request
+
+ def params
+ @request.query_parameters
+ end
+
+ def header(header, value)
+ @response.headers[header] = value
+ end
+ end
+ end
+end