Class: Mmultilogger
- Inherits:
-
Object
- Object
- Mmultilogger
- Defined in:
- lib/mmultilogger.rb,
lib/mmultilogger/version.rb
Constant Summary collapse
- VERSION =
"0.1.0"
Instance Attribute Summary collapse
-
#loggers ⇒ Object
readonly
Returns the value of attribute loggers.
Instance Method Summary collapse
-
#initialize(*loggers) ⇒ Mmultilogger
constructor
A new instance of Mmultilogger.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(*loggers) ⇒ Mmultilogger
Returns a new instance of Mmultilogger.
4 5 6 |
# File 'lib/mmultilogger.rb', line 4 def initialize(*loggers) @loggers = loggers.flatten end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
8 9 10 11 12 |
# File 'lib/mmultilogger.rb', line 8 def method_missing(method, *args, &block) loggers.map do |logger| logger.public_send(method, *args, &block) end end |
Instance Attribute Details
#loggers ⇒ Object (readonly)
Returns the value of attribute loggers.
14 15 16 |
# File 'lib/mmultilogger.rb', line 14 def loggers @loggers end |