Class: ActionDispatch::Response::Header
- Inherits:
-
Hash
- Object
- Hash
- ActionDispatch::Response::Header
- Defined in:
- lib/action_dispatch/http/response.rb
Overview
:nodoc:
Instance Method Summary collapse
- #[]=(k, v) ⇒ Object
-
#initialize(response, header) ⇒ Header
constructor
A new instance of Header.
- #merge(other) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(response, header) ⇒ Header
Returns a new instance of Header.
37 38 39 40 |
# File 'lib/action_dispatch/http/response.rb', line 37 def initialize(response, header) @response = response super(header) end |
Instance Method Details
#[]=(k, v) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/action_dispatch/http/response.rb', line 42 def []=(k,v) if @response.sending? || @response.sent? raise ActionDispatch::IllegalStateError, 'header already sent' end super end |
#merge(other) ⇒ Object
50 51 52 |
# File 'lib/action_dispatch/http/response.rb', line 50 def merge(other) self.class.new @response, __getobj__.merge(other) end |
#to_hash ⇒ Object
54 55 56 |
# File 'lib/action_dispatch/http/response.rb', line 54 def to_hash __getobj__.dup end |