Sha256: 82ecd29878f613d8ea1160fe93e58e7c02a0c49a6a5cae3ae82635aae18292a7
Contents?: true
Size: 596 Bytes
Versions: 13
Compression:
Stored size: 596 Bytes
Contents
class MessageStore < Hyperloop::Store state :messages, scope: :class, reader: :all state :user_name, scope: :class, reader: true def self.online? state.messages end receives Operations::Join do |params| puts "receiving Operations::Join(#{params})" mutate.user_name params.user_name end receives Operations::GetMessages do |params| puts "receiving Operations::GetMessages(#{params})" mutate.messages params.messages end receives Operations::Send do |params| puts "receiving Operations::Send(#{params})" mutate.messages << params.message end end
Version data entries
13 entries across 13 versions & 1 rubygems