Project

General

Profile

Actions

Bug #11064

closed

#singleton_methods for objects with special singleton_class returns an empty array

Added by rbjl (Jan Lelis) over 9 years ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
[ruby-core:<unknown>]

Description

def nil.bla
  42  
end

# works
nil.bla #=> 42
nil.singleton_method(:bla) #=> #<Method: NilClass#bla>
NilClass.instance_methods.include? :bla #=> true

# does not work
nil.singleton_methods #=> []

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #11063: Special singleton class should return true for singleton_class? testRejectedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like1Like0Like0Like1Like0Like0Like0Like0