Class: DocumentChannel
- Inherits:
-
ApplicationCable::Channel
- Object
- ApplicationCable::Channel
- DocumentChannel
- Includes:
- Y::ActionCable
- Defined in:
- lib/generators/yrby/install/templates/document_channel.rb
Overview
Collaborative documents over Action Cable: one channel speaking the y-websocket protocol (sync plus presence). Storage is Y::Document + Y::DocumentUpdate; a document is created on its first change and its history goes with it when it is destroyed. Point on_load/on_change elsewhere to swap storage.
Instance Method Summary collapse
Instance Method Details
#receive(data) ⇒ Object
25 |
# File 'lib/generators/yrby/install/templates/document_channel.rb', line 25 def receive(data) = sync_receive(data, params[:id]) |
#subscribed ⇒ Object
19 20 21 22 23 |
# File 'lib/generators/yrby/install/templates/document_channel.rb', line 19 def subscribed return reject unless (params[:id]) sync_subscribed(params[:id]) end |