Class: Tipi::Listener
- Inherits:
-
Object
- Object
- Tipi::Listener
- Defined in:
- lib/tipi/controller/web_stock.rb
Instance Method Summary collapse
- #accept ⇒ Object
-
#initialize(server, &handler) ⇒ Listener
constructor
A new instance of Listener.
Constructor Details
#initialize(server, &handler) ⇒ Listener
Returns a new instance of Listener.
12 13 14 15 |
# File 'lib/tipi/controller/web_stock.rb', line 12 def initialize(server, &handler) @server = server @handler = handler end |
Instance Method Details
#accept ⇒ Object
17 18 19 20 |
# File 'lib/tipi/controller/web_stock.rb', line 17 def accept socket, _addrinfo = @server.accept @handler.call(socket) end |