Class: DexieCable::ScopedChannel

Inherits:
Object
  • Object
show all
Defined in:
lib/dexiecable/scoped_channel.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass, subject) ⇒ ScopedChannel

Returns a new instance of ScopedChannel.



5
6
7
8
# File 'lib/dexiecable/scoped_channel.rb', line 5

def initialize(klass, subject)
  @klass   = klass
  @subject = subject
end

Instance Method Details

#table(name) ⇒ Object



10
11
12
# File 'lib/dexiecable/scoped_channel.rb', line 10

def table(name)
  Query.new(self, name)
end

#transmit(data) ⇒ Object



14
15
16
# File 'lib/dexiecable/scoped_channel.rb', line 14

def transmit(data)
  @klass.broadcast_to @subject, data
end