Project

General

Profile

Actions

Bug #7700

closed

Assignment to an Constant does not give an singleton_class its name

Added by Hanmac (Hans Mackowiak) about 11 years ago. Updated about 11 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
Backport:
[ruby-core:51443]

Description

object = Object.new

ABC = object.singleton_class

class ABC
module D
end
end

class << object
module E
end
end

p ABC #=> #<Class:#Object:0x00000001957c88>
p ABC::D #=> ABC::D
p ABC::E #=> ABC::E

as you guys can see, and module into an singleton class get its right name, but the singleton_class itself does not get its name

Updated by nobu (Nobuyoshi Nakada) about 11 years ago

  • Status changed from Open to Rejected

It's an intended behavior.
`ABC.name' gives "ABC" instead.

Actions

Also available in: Atom PDF

Like0
Like0