class Response::Header

Attributes

data[R]

Public Class Methods

new() click to toggle source
# File lib/lux/response/lib/header.rb, line 5
def initialize
  @data = {}
end

Public Instance Methods

[](key) click to toggle source
# File lib/lux/response/lib/header.rb, line 9
def [] key
  @data[key.downcase]
end
[]=(key, value) click to toggle source
# File lib/lux/response/lib/header.rb, line 13
def []= key, value
  @data[key.downcase] = value
end
delete(name) click to toggle source
# File lib/lux/response/lib/header.rb, line 25
def delete name
  @data.delete name.downcase
end
merge(hash) click to toggle source
# File lib/lux/response/lib/header.rb, line 17
def merge hash
  for key, value in hash
    @data[key.downcase] = value
  end

  @data
end
to_h() click to toggle source
# File lib/lux/response/lib/header.rb, line 29
def to_h
  # data['Set-Cookie'] = data.delete('set-cookie') if data['set-cookie']
  @data#.to_h.sort.to_h
end