Class: Lux::Response::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/lux/response/lib/header.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHeader

Returns a new instance of Header.



5
6
7
# File 'lib/lux/response/lib/header.rb', line 5

def initialize
  @data = {}
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/lux/response/lib/header.rb', line 3

def data
  @data
end

Instance Method Details

#[](key) ⇒ Object



9
10
11
# File 'lib/lux/response/lib/header.rb', line 9

def [] key
  @data[key.downcase]
end

#[]=(key, value) ⇒ Object



13
14
15
# File 'lib/lux/response/lib/header.rb', line 13

def []= key, value
  @data[key.downcase] = value
end

#to_hObject



17
18
19
# File 'lib/lux/response/lib/header.rb', line 17

def to_h
  @data.to_h.sort.to_h
end