るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.296秒)
トップページ > クエリ:_builtin[x] > クエリ:new[x] > ライブラリ:ビルトイン[x] > クエリ:<[x] > クエリ:kind_of?[x]

別のキーワード

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

クラス

検索結果

Object#kind_of?(mod) -> bool (23120.0)

オブジェクトが指定されたクラス mod かそのサブクラスのインスタンスであるとき真を返します。

...ジュールなど、Moduleかそのサブクラスのインスタンスです。

//emlist[][ruby]{
module M
end
class C < Object
include M
end
class S < C
end

obj = S.new
p obj.is_a?(S) # true
p obj.is_a?(C) # true
p obj.is_a?(Object) # true
p obj.is_a?(M) # true
p obj.is_a?(...