Florian Growrote:
> Daniel Sche wrote:
>
> > irb(main):177:0* y=0
> > => 0
> > irb(main):178:0> def y; 1; end
> > => nil
> > irb(main):179:0> y
> > => 0
> > irb(main):180:0> y()
> > => 1
> > irb(main):181:0> y.class
> > => Fixnum
> > irb(main):182:0>
> >
> > how to get the class of the function y?
> > or object_id for example?
>
> method(:y).class or method(:y).object_id

Note, though, that repeated calls to method(:y) will return different
objects. It creates a Method object that represents to the method
self.y, but it doesn't return the method itself, which is not an object.