Class: LoggerHolder
- Inherits:
-
Object
- Object
- LoggerHolder
- Defined in:
- lib/source/logger_holder.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ LoggerHolder
constructor
A new instance of LoggerHolder.
Constructor Details
#initialize ⇒ LoggerHolder
Returns a new instance of LoggerHolder.
7 8 9 |
# File 'lib/source/logger_holder.rb', line 7 def initialize @logger = Logger.new(STDOUT) end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
5 6 7 |
# File 'lib/source/logger_holder.rb', line 5 def logger @logger end |
Class Method Details
.instance ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/source/logger_holder.rb', line 11 def self.instance return @instance.logger if @instance @instance_mutex.synchronize do @instance ||= new end @instance.logger end |