< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #12345 has been updated by Nobuyoshi Nakada.
Tracker changed from Bug to Feature
----------------------------------------
Feature #12345: A module's private constants are given with `Module#constant(false)`
https://bugs.ruby-lang.org/issues/12345#change-58589
* Author: Tsuyoshi Sawada
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
A module's private constants are given with `Module#constant(false)`.
~~~ruby
module A
X = 1
Y = 2
private_constant :Y
end
module B
Z = 3
W = 4
private_constant :W
end
A.constants # => [:X]
A.constants(false) # => [:X, :Y]
A.include B
A.constants # => [:X, :Z]
A.constants(false) # => [:X, :Y]
~~~
Besides this, I request a way to get the private constants of a module. I want:
~~~ruby
A.private_constants # => [:Y]
A.private_constants(false) # => [:Y]
A.include B
A.private_constants # => [:Y, :W]
A.private_constants(false) # => [:Y]
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>