Project

General

Profile

Actions

Feature #11905

closed

Change the 'class' keyword to return a symbol

Added by yuki24 (Yuki Nishijima) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:72546]

Description

Currently the class keyword returns nil:

class Person; end # => nil

It would be great if it could return a symbol instead:

class Person; end # => :Person

If we make it so we'll be able to do something like below:

private_constant class User
  ...
end

Related issues 1 (1 open0 closed)

Related to Ruby master - Feature #8839: Class and module should return the class or module that was openedAssignedmatz (Yukihiro Matsumoto)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0