UNIVERSAL::tap
æè¿ä»äºæRubyå¨ã§ãã¹ãå¨ãªãã§ããã©ãä¹ ãã¶ãã«ãªãããªã§Perlã¢ã¸ã¥ã¼ã«æ¸ãã¦ã¿ã¾ããã
Rubyã«ã¯ãã¬ã·ã¼ããå¼æ°ã«ãããã¯è©ä¾¡ãã¦ã¬ã·ã¼ãèªèº«ãè¿ãtapã¨ãã便å©ãªã¡ã½ããããã£ã¦ãæ°ãã¤ãã°ãã使ã£ã¦ããã®ã§ãããPerlã«ç§»æ¤ãã¦ã¿ã¾ããã
http://github.com/masaki/UNIVERSAL-tap
# before my $module = Module->new; $module->foo; $module->bar; $module->baz; $module->run; # after use UNIVERSAL::tap; my $module = Module->new->tap(sub { $_[0]->foo; $_[0]->bar; $_[0]->baz; })->run;
ä¾ãã¢ã¬ãªã®ã§ã¡ãªãããæããããªãæ°ããã¾ãããã¡ã½ãããã§ã¼ã³æé«ï¼ã¨ãã人ã«ã¯ãã£ã¦ã¤ãã§ããã