Class: Semlogger::Multiplex
Instance Method Summary collapse
- #close(*a, &e) ⇒ Object
-
#initialize(*dests) ⇒ Multiplex
constructor
A new instance of Multiplex.
- #method_missing(m, *a, &e) ⇒ Object
- #write(*a, &e) ⇒ Object
Constructor Details
#initialize(*dests) ⇒ Multiplex
Returns a new instance of Multiplex.
2 |
# File 'lib/semlogger/multiplex.rb', line 2 def initialize( *dests) @__dests__ = dests end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *a, &e) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/semlogger/multiplex.rb', line 6 def method_missing( m, *a, &e) if :'level=' == m and false p multiplex: m, a: a puts Kernel.caller.map {|l| "\t%s" % l } end r = true @__dests__.each {|d| r = d.send m, *a, &e } if :level == m and false p return: r, multiplex: m, d: @__dests__.last puts Kernel.caller.map {|l| "\t%s" % l } end r end |