builtin singleton & instance_methods

  • Thread starter Marcin MielżyÅ„ski
  • Start date
M

Marcin Mielżyński

Hi,

given:


s="some string"

def s.some_meth
end

class << s
p self.instance_methods(false)
end

why instance_methods doesn't return only the name of a method defined
for singletons class ? I've found that this is also true for other
builtin types that have _basic_ structure. I've also looked into
ins_methods_push and class_instance_method_list in Ruby sources, but
haven't found any clues...

JRuby behaves the expected way...

lopex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top