private_constant(*name) -> self
[permalink][rdoc]name で指定した定数の可視性を private に変更します。
[SEE_ALSO] Module#public_constant, Object#untrusted?
例:
module Foo BAR = 'bar' class Baz; end QUX = 'qux' class Quux; end private_constant :QUX private_constant :Quux end Foo::BAR # => "bar" Foo::Baz # => Foo::Baz Foo::QUX # => NameError: private constant Foo::QUX referenced Foo::Quux # => NameError: private constant Foo::Quux referenced