El Martes 31 Marzo 2009, I=F1aki Baz Castillo escribi=F3:
> El Martes 31 Marzo 2009, I=F1aki Baz Castillo escribi=F3:
> > Fantastic! Thanks a lot.
>
> If somebody is interested, I've implemented the above code adding Class
> methods logging feature:
>
> ----------------
> module Kernel
>
> 	def this_method
> 		if self.class =3D=3D Class
> 			"#{self.to_s}.#{caller[0][/`(.*)'/, 1]}"
> 		else
> 			"#{self.class}##{caller[0][/`(.*)'/, 1]}"
> 		end
> 	end
> 	private :this_method
>
> end
>
>
>
> module MM
> 	class AA
> 		def self.class_method
> 			puts this_method
> 		end
>
> 		def instance_method
> 			puts this_method
> 		end
> 	end
> end
>
>
> MM::AA.class_method
> =3D> "MM::AA.class_method"
>
> MM::AA.new.instance_method
> =3D> "MM::AA#instance_method"
> ----------------


Hi again. Wouldn't make sense to have such features in Ruby core instead of=
=20
having to parse "caller[0][/`(.*)'/, 1]" and so?

Is it possible to open a feature request for it? or is it too late for such=
=20
wishes in 1.9?

Thanks.


=2D-=20
I=F1aki Baz Castillo <ibc / aliax.net>