class Volt::ChannelStub

Behaves the same as the Channel class, only the Channel class uses sockjs to pass messages to the backend. ChannelStub, simply passes them directly to SocketConnectionHandlerStub.

Attributes

error[R]
reconnect_interval[R]
state[R]

Public Class Methods

new() click to toggle source
# File lib/volt/page/channel_stub.rb, line 16
def initialize
  @state = :connected
end

Public Instance Methods

close!() click to toggle source
# File lib/volt/page/channel_stub.rb, line 33
def close!
  fail 'close! should not be called on the backend channel'
end
message_received(*message) click to toggle source
# File lib/volt/page/channel_stub.rb, line 25
def message_received(*message)
  trigger!('message', *message)
end
opened() click to toggle source
# File lib/volt/page/channel_stub.rb, line 20
def opened
  trigger!('open')
  trigger!('changed')
end
send_message(message) click to toggle source
# File lib/volt/page/channel_stub.rb, line 29
def send_message(message)
  SocketConnectionHandlerStub.new(self).process_message(message)
end