Class: IRuby::MultiLogger

Inherits:
BasicObject
Defined in:
lib/iruby/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*loggers) ⇒ MultiLogger

Returns a new instance of MultiLogger


11
12
13
# File 'lib/iruby/logger.rb', line 11

def initialize(*loggers)
  @loggers = loggers
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &b) ⇒ Object


15
16
17
# File 'lib/iruby/logger.rb', line 15

def method_missing(name, *args, &b)
  @loggers.map {|x| x.respond_to?(name) && x.public_send(name, *args, &b) }.any?
end

Instance Attribute Details

#loggersObject (readonly)

Returns the value of attribute loggers


9
10
11
# File 'lib/iruby/logger.rb', line 9

def loggers
  @loggers
end