Module: Goat::JSONMessages
- Defined in:
- lib/goat/net-common.rb
Overview
for use with EM::Connection
Instance Method Summary collapse
Instance Method Details
#send_message(type, msg) ⇒ Object
29 30 31 |
# File 'lib/goat/net-common.rb', line 29 def (type, msg) send_data(msg.merge('type' => type).to_json + "\n") end |
#send_messages(msgs) ⇒ Object
33 34 35 |
# File 'lib/goat/net-common.rb', line 33 def (msgs) send_data(msgs.map{|msg| msg[1].merge('type' => msg[0])}.to_json + "\n") end |