From: "Iñaki Baz Castillo" Date: 2008-04-08T05:39:57+09:00 Subject: Re: Is possible to define various methods at same time? El Lunes, 7 de Abril de 2008, Nobuyoshi Nakada escribió: > Hi, > > At Sun, 6 Apr 2008 22:54:52 +0900, > > Iñaki Baz Castillo wrote in [ruby-talk:297234]: > > Hi, is possible to define various methods in a single declaration? > > something as: > > > > def method1, method2 (args) > > ... > > end > > > > Of course the above doesn't work, anyway to do it? > > Do you want alias? > > def method1(args) > ... > end > alias method2 method1 I don't think aliases are valid for me since I want each method call "super" (inheritance): 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 And I want: def debug,info,war,error,fatal,unknown(log_zone, msg) super(formatter(log_zone, msg)) end Thanks a lot. -- Iñaki Baz Castillo