Class: SCGI::LogFactory
- Inherits:
-
Monitor
- Object
- Monitor
- SCGI::LogFactory
- Includes:
- Singleton
- Defined in:
- lib/scgi.rb
Overview
A factory that makes Log objects, making sure that one Log is associated with each log file.
Instance Method Summary collapse
- #create(file) ⇒ Object
-
#initialize ⇒ LogFactory
constructor
A new instance of LogFactory.
Constructor Details
#initialize ⇒ LogFactory
Returns a new instance of LogFactory.
15 16 17 18 |
# File 'lib/scgi.rb', line 15 def initialize super() @@logs = {} end |
Instance Method Details
#create(file) ⇒ Object
20 21 22 |
# File 'lib/scgi.rb', line 20 def create(file) synchronize{@@logs[file] ||= Log.new(file)} end |