るりまサーチ (Ruby 2.7.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.254秒)
トップページ > バージョン:2.7.0[x] > クラス:Module[x] > クエリ:singleton_class?[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

検索結果

Module#singleton_class? -> bool (54343.0)

self が特異クラスの場合に true を返します。そうでなければ false を返し ます。

self が特異クラスの場合に true を返します。そうでなければ false を返し
ます。

//emlist[例][ruby]{
class C
end
C.singleton_class? # => false
C.singleton_class.singleton_class? # => true
//}