class GetSchwifty::Cable::Base

:nodoc

Attributes

identifiers[R]
params[R]
schwifty_job_id[R]

Public Class Methods

new(schwifty_job_id, params, identifiers) click to toggle source
# File lib/get_schwifty/cable/base.rb, line 9
def initialize(schwifty_job_id, params, identifiers)
  @schwifty_job_id = schwifty_job_id
  @identifiers = identifiers.symbolize_keys!
  @params = params
end

Private Instance Methods

redirect(url) click to toggle source
# File lib/get_schwifty/cable/base.rb, line 25
def redirect(url)
  ActionCable.server.broadcast(
    schwifty_job_id,
    status: 302,
    body: url
  )
end
stream(*args) click to toggle source
# File lib/get_schwifty/cable/base.rb, line 17
def stream(*args)
  ActionCable.server.broadcast(
    schwifty_job_id,
    status: 200,
    body: GetSchwiftyController.renderer.new.render(*args).squish
  )
end