Module: Ruflet
- Defined in:
- lib/ruflet/server.rb,
lib/ruflet_server.rb,
lib/ruflet/version.rb,
lib/ruflet/server/wire_codec.rb,
lib/ruflet/server/web_socket_connection.rb
Defined Under Namespace
Classes: Server, WebSocketConnection, WireCodec
Constant Summary collapse
- VERSION =
"0.0.11"
Class Method Summary collapse
Class Method Details
.run(entrypoint = nil, host: "0.0.0.0", port: 8550, &block) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/ruflet_server.rb', line 9 def run(entrypoint = nil, host: "0.0.0.0", port: 8550, &block) callback = entrypoint || block raise ArgumentError, "Ruflet.run requires a callable entrypoint or block" unless callback.respond_to?(:call) Server.new(host: host, port: port) do |page| callback.call(page) end.start end |