るりまサーチ (Ruby 2.6.0)

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

別のキーワード

  1. module ancestors
  2. _builtin ancestors
  3. ancestors module
  4. ancestors _builtin
  5. rb_mod_ancestors

ライブラリ

検索結果

Module#<=(other) -> bool | nil (54448.0)

比較演算子。self が other の子孫であるか、self と other が 同一クラスである場合、 true を返します。 self が other の先祖である場合、false を返します。

...クラス

@raise TypeError other がクラスやモジュールではない場合に発生します。

@see Module#<

//emlist[例][ruby]{
module
Foo; end
module
Bar
include Foo
end
module
Baz
prepend Foo
end

Bar.ancestors # => [Bar, Foo]
Foo <= Bar # => false
Bar <= Foo # => true

Baz.ancest...