I can''t count the times I''ve found it useful to jump to console and list the methods on an object. Of course, the default "methods" method includes an extra 50 items. So I''m always typing "@object.methods - Kernel.methods". Am I alone? I wrote a patch that adds my_methods onto Object, which just acts as a shortcut. I can understand if people don''t think it belongs in the core framework, but I think it''s one of those small conveniences, like Symbol#to_proc, that make Rails a pleasure. Please provide feedback: http://rails.lighthouseapp.com/projects/8994/tickets/240-a-useful-methods-with-my_methods --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
2008/5/23 Sandofsky :> > I can''t count the times I''ve found it useful to jump to console and > list the methods on an object. Of course, the default "methods" method > includes an extra 50 items. So I''m always typing "@object.methods - > Kernel.methods". Am I alone?-1. Just pass the argument false to #methods, i.e. @object.methods(false) Or for a class, klass.instance_methods(false) It should work for all the *methods family : instance_methods, private_instance_methods, protected_instance_methods, public_instance_methods, ... and so on. -- Jean-François. -- http://twitter.com/underflow_ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Fri, May 23, 2008 at 2:51 AM, Jean-François Trân <jftran@rubyfrance.org> wrote:> Just pass the argument false to #methods, i.e. @object.methods(false) > Or for a class, klass.instance_methods(false)This doesn''t work for me. At least not for String and Hash. Is it only in 1.9? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---