るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.140秒)
トップページ > クエリ:t[x] > クエリ:Ruby[x] > 種類:インスタンスメソッド[x] > クエリ:end[x] > クエリ:begin[x] > クラス:Module[x] > ライブラリ:ビルトイン[x]

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

検索結果

Module#public_constant(*name) -> self (6140.0)

name で指定した定数の可視性を public に変更します。

...String か Symbol を指定します。

@raise NameError 存在しない定数を指定した場合に発生します。

@return self を返します。

//emlist[例][ruby]{
module
SampleModule
class SampleInnerClass
end


# => 非公開クラスであることを明示するために privat...
...ate_constant :SampleInnerClass
end


begin

SampleModule::SampleInnerClass
rescue => e
e # => #<NameError: private constant SampleModule::SampleInnerClass referenced>
end


module
SampleModule
# => 非公開クラスであることは承知で利用するために public にする
public_consta...
...nt :SampleInnerClass
end


SampleModule::SampleInnerClass # => SampleModule::SampleInnerClass
//}

@see Module#private_constant, Object#untrusted?...
...nt :SampleInnerClass
end


SampleModule::SampleInnerClass # => SampleModule::SampleInnerClass
//}

@see Module#private_constant...