Class: Lux::Response::Header
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ Header
constructor
A new instance of Header.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Header
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
#data ⇒ Object (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_h ⇒ Object
17 18 19 |
# File 'lib/lux/response/lib/header.rb', line 17 def to_h @data.to_h.sort.to_h end |