Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
How do you know what class defines method foo()?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Dominik Bathon, post: 4498155"] I just played a bit around and found Method#inspect: =3D> #<Method: Array#send> So, if just want to know it for one case, use irb and look at =20 Method#inspect. To write a method that returns the class/module that defines a method one= =20 might parse the output of Method#inspect, but I think that is not very =20 nice. There doesn't seem to be a direct way to get the class/module in Ruby. Dominik [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
How do you know what class defines method foo()?
Top