Class: Gitlab::Pagination::Keyset::HeaderBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/pagination/keyset/header_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_context) ⇒ HeaderBuilder

Returns a new instance of HeaderBuilder.


10
11
12
# File 'lib/gitlab/pagination/keyset/header_builder.rb', line 10

def initialize(request_context)
  @request_context = request_context
end

Instance Attribute Details

#request_contextObject (readonly)

Returns the value of attribute request_context


7
8
9
# File 'lib/gitlab/pagination/keyset/header_builder.rb', line 7

def request_context
  @request_context
end

Instance Method Details

#add_next_page_header(query_params) ⇒ Object


14
15
16
17
18
# File 'lib/gitlab/pagination/keyset/header_builder.rb', line 14

def add_next_page_header(query_params)
  link = next_page_link(page_href(query_params))
  header('Links', link)
  header('Link', link)
end