Class: MadChatter::Server
- Inherits:
-
Object
- Object
- MadChatter::Server
- Defined in:
- lib/mad_chatter/server.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ Server
constructor
A new instance of Server.
- #initialize_server ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(config) ⇒ Server
Returns a new instance of Server.
4 5 6 7 |
# File 'lib/mad_chatter/server.rb', line 4 def initialize(config) @config = config @server = initialize_server end |
Instance Method Details
#initialize_server ⇒ Object
9 10 11 |
# File 'lib/mad_chatter/server.rb', line 9 def initialize_server return MadChatter::Servers::EventMachineWebSocket.new(@config['websocket_port'], self) end |
#start ⇒ Object
13 14 15 16 17 18 |
# File 'lib/mad_chatter/server.rb', line 13 def start EM.run do puts "Starting Mad Chatter Web Socket server on port #{@config['websocket_port']}." @server.start end end |