El Lunes, 7 de Abril de 2008, Robert Klemme escribi=F3:
Can you explain why you need this? Maybe there is a different
solution altogether. This redundancy in method definitions is
irritating to me and I suspect there might be a better way to achieve
what you really need.
Thanks a lot. Finally it was not so important for me as I thought initially=
,=20
so I can avoid using it. I asked that for the following reason:
I'm using CusomLogger class that inherits from Logger class. And I want to=
=20
modify some methods, all exactly the same:
def debug(log_zone, msg) super(formatter(log_zone, msg)) end
def info(log_zone, msg) super(formatter(log_zone, msg)) end
def warn(log_zone, msg) super(formatter(log_zone, msg)) end
def error(log_zone, msg) super(formatter(log_zone, msg)) end
def fatal(log_zone, msg) super(formatter(log_zone, msg)) end
def unknown(log_zone, msg) super(formatter(log_zone, msg)) end
As you can see, all the methods body is exactly the same. I expected there=
=20
could be a cool way to do something as:
def debug,info,war,error,fatal,unknown(log_zone, msg)
super(formatter(log_zone, msg))
end
just it.
Thanks a lot for your help.
=2D-=20
I=F1aki Baz Castillo