Method: ActionController::Live::SSE#write

Defined in:
actionpack/lib/action_controller/metal/live.rb

#write(object, options = {}) ⇒ Object



124
125
126
127
128
129
130
131
# File 'actionpack/lib/action_controller/metal/live.rb', line 124

def write(object, options = {})
  case object
  when String
    perform_write(object, options)
  else
    perform_write(ActiveSupport::JSON.encode(object), options)
  end
end