Project

General

Profile

Actions

Feature #16752

open

:private param for const_set

Added by bughit (bug hit) about 4 years ago. Updated about 4 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:97678]

Description

Defining a private constant should not require two method calls.

You want to encourage private declarations because they communicate intent better and are easier to refactor, two statements discourage it.

Ideally there should be compact syntax for direct private declarations, but that's probably a difficult change.

But const_set :FOO, 1, private: true or const_set :FOO, 1, :private should be trivial


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #17171: Why is the visibility of constants not affected by `private`?RejectedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0