36件ヒット
[1-36件を表示]
(0.010秒)
ライブラリ
- ビルトイン (36)
キーワード
-
const
_ missing (12) -
singleton
_ class? (12) - using (12)
検索結果
-
Module
# const _ missing(name) (6101.0) -
定義されていない定数を参照したときに Ruby インタプリタが このメソッドを呼びます。
...mbol
@raise NameError このメソッドを呼び出した場合、デフォルトで発生する例外
//emlist[例][ruby]{
class Foo
def Foo.const_missing(id)
warn "undefined constant #{id.inspect}"
end
Bar
end
Foo::Bar
# => undefined constant :Bar
# undefined constant :Bar
//}... -
Module
# singleton _ class? -> bool (6101.0) -
self が特異クラスの場合に true を返します。そうでなければ false を返し ます。
...self が特異クラスの場合に true を返します。そうでなければ false を返し
ます。
//emlist[例][ruby]{
class C
end
C.singleton_class? # => false
C.singleton_class.singleton_class? # => true
//}... -
Module
# using(module) -> self (6101.0) -
引数で指定したモジュールで定義された拡張を現在のクラス、モジュールで有 効にします。
...ルで有
効にします。
有効にした拡張の有効範囲については以下を参照してください。
* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html#label-Scope
@param module 有効にするモジュールを指定します。
@see Module#refine, main.using...