Project

General

Profile

Actions

Feature #1082

closed

add Object#singleton_class method

Added by sunaku (Suraj Kurapati) almost 16 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
[ruby-core:21702]

Description

=begin
Please add Object#singleton_class method to the Ruby API.

This method would allow us to write:

hello.singleton_class

Instead of always having to write:

(class << hello; self; end)

Furthermore, the name "singleton_class" should be used
to minimize disruption to the existing Ruby API, which
already uses the name "singleton":

Object.instance_methods.grep(/singleton/)
=> [:singleton_methods, :define_singleton_method]

RUBY_DESCRIPTION
=> "ruby 1.9.1p0 (2009-01-20 revision 21700) [i686-linux]"

Thanks for your consideration.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0