Class: MediafluxChannel

Inherits:
ApplicationCable::Channel show all
Defined in:
app/channels/mediaflux_channel.rb

Instance Method Summary collapse

Instance Method Details

#subscribedObject



3
4
5
# File 'app/channels/mediaflux_channel.rb', line 3

def subscribed
  update_state
end

#unsubscribedObject



7
8
9
# File 'app/channels/mediaflux_channel.rb', line 7

def unsubscribed
  transmit({ state: false })
end

#update_stateObject



11
12
13
14
15
# File 'app/channels/mediaflux_channel.rb', line 11

def update_state
  state = mf_version.present?

  transmit({ state: state })
end