class Gitlab::Headers::Total

Parses total header.

@private

Constants

HEADER_TOTAL
TOTAL_REGEX

Attributes

total[RW]

Public Class Methods

new(headers) click to toggle source
# File lib/gitlab/headers/total.rb, line 14
def initialize(headers)
  header_total = headers[HEADER_TOTAL]

  extract_total(header_total) if header_total
end

Private Instance Methods

extract_total(header_total) click to toggle source
# File lib/gitlab/headers/total.rb, line 22
def extract_total(header_total)
  TOTAL_REGEX.match(header_total.strip) do |match|
    @total = match[0]
  end
end