8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/channels/glib/channel/appearance_channel.rb', line 8
def status(data)
action = {
action: Glib::JsonUi::Name.for('labels/set'),
targetId: 'label-1',
text: data['text'],
onSet: {
action: Glib::JsonUi::Name.for('timeouts/set'),
interval: 3000,
timerId: 'label-1-set',
onTimeout: {
action: Glib::JsonUi::Name.for('labels/set'),
targetId: 'label-1',
text: "Room ##{data['room'].upcase}"
}
}
}
broadcast_to("appearance_#{data['room']}", action)
end
|