Class: ActionController::Live::Response::Header

Inherits:
Hash
  • Object
show all
Defined in:
lib/action_controller/metal/live.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(response, header) ⇒ Header

Returns a new instance of Header.



209
210
211
212
# File 'lib/action_controller/metal/live.rb', line 209

def initialize(response, header)
  @response = response
  super(header)
end

Instance Method Details

#[]=(k, v) ⇒ Object



214
215
216
217
218
219
220
# File 'lib/action_controller/metal/live.rb', line 214

def []=(k,v)
  if @response.committed?
    raise ActionDispatch::IllegalStateError, 'header already sent'
  end

  super
end

#merge(other) ⇒ Object



222
223
224
# File 'lib/action_controller/metal/live.rb', line 222

def merge(other)
  self.class.new @response, __getobj__.merge(other)
end

#to_hashObject



226
227
228
# File 'lib/action_controller/metal/live.rb', line 226

def to_hash
  __getobj__.dup
end