るりまサーチ (Ruby 3.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.086秒)
トップページ > クエリ:i[x] > クエリ:Include[x] > バージョン:3.0[x] > クエリ:defined_class[x]

別のキーワード

  1. _builtin include?
  2. socket mcast_include
  3. ipaddr include?
  4. _builtin include
  5. set include?

ライブラリ

クラス

検索結果

TracePoint#defined_class -> Class | module (81712.0)

メソッドを定義したクラスかモジュールを返します。

メソッドを定義したクラスかモジュールを返します。

//emlist[例][ruby]{
class C; def foo; end; end
trace = TracePoint.new(:call) do |tp|
p tp.defined_class # => C
end.enable do
C.new.foo
end
//}

メソッドがモジュールで定義されていた場合も(include に関係なく)モジュー
ルを返します。

//emlist[例][ruby]{
module M; def foo; end; end
class C; include M; end;
trac...