Class: Druzy::Server::OneInstanceByPort
- Inherits:
-
Object
- Object
- Druzy::Server::OneInstanceByPort
- Defined in:
- lib/druzy/server/one_instance_by_port.rb
Direct Known Subclasses
Constant Summary collapse
- @@instances =
{}
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(port) ⇒ OneInstanceByPort
constructor
A new instance of OneInstanceByPort.
Constructor Details
#initialize(port) ⇒ OneInstanceByPort
Returns a new instance of OneInstanceByPort.
8 9 10 |
# File 'lib/druzy/server/one_instance_by_port.rb', line 8 def initialize(port) @server=WEBrick::HTTPServer.new(:Port => port, :AccessLog => [], :Logger => WEBrick::Log.new(File::NULL)) end |
Class Method Details
.instance(port) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/druzy/server/one_instance_by_port.rb', line 12 def self.instance(port) if !@@instances.has_key?(port) @@instances[port]=new(port) end @@instances[port] end |