Class: Gitlab::Headers::Total

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/headers/total.rb

Overview

Parses total header.

Constant Summary collapse

HEADER_TOTAL =
'x-total'
TOTAL_REGEX =
/^\d+$/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(headers) ⇒ Total

Returns a new instance of Total.



14
15
16
17
18
# File 'lib/gitlab/headers/total.rb', line 14

def initialize(headers)
  header_total = headers[HEADER_TOTAL]

  extract_total(header_total) if header_total
end

Instance Attribute Details

#totalObject

Returns the value of attribute total.



12
13
14
# File 'lib/gitlab/headers/total.rb', line 12

def total
  @total
end