Class: Plum::Rack::TCPListener
- Inherits:
-
BaseListener
- Object
- BaseListener
- Plum::Rack::TCPListener
- Defined in:
- lib/plum/rack/listener.rb
Instance Method Summary collapse
-
#initialize(lc) ⇒ TCPListener
constructor
A new instance of TCPListener.
- #plum(sock) ⇒ Object
- #to_io ⇒ Object
Methods inherited from BaseListener
Constructor Details
#initialize(lc) ⇒ TCPListener
Returns a new instance of TCPListener.
19 20 21 |
# File 'lib/plum/rack/listener.rb', line 19 def initialize(lc) @server = ::TCPServer.new(lc[:hostname], lc[:port]) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Plum::Rack::BaseListener
Instance Method Details
#plum(sock) ⇒ Object
27 28 29 |
# File 'lib/plum/rack/listener.rb', line 27 def plum(sock) ::Plum::HTTPServerConnection.new(sock) end |
#to_io ⇒ Object
23 24 25 |
# File 'lib/plum/rack/listener.rb', line 23 def to_io @server.to_io end |