Class: GdsApi::GovukHeaders

Inherits:
Object
  • Object
show all
Defined in:
lib/gds_api/govuk_headers.rb

Class Method Summary collapse

Class Method Details

.clear_headersObject


12
13
14
# File 'lib/gds_api/govuk_headers.rb', line 12

def clear_headers
  Thread.current[:headers] = {}
end

.headersObject


8
9
10
# File 'lib/gds_api/govuk_headers.rb', line 8

def headers
  header_data.select { |_k, v| !(v.nil? || v.empty?) }
end

.set_header(header_name, value) ⇒ Object


4
5
6
# File 'lib/gds_api/govuk_headers.rb', line 4

def set_header(header_name, value)
  header_data[header_name] = value
end