るりまサーチ

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

別のキーワード

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

ライブラリ

検索結果

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

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

...

@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.ancestors # => [Foo, Baz]
Foo <= Baz # => false
Baz <= Foo # => true

Foo <= Foo # => true
Foo <= Object #...

Module#<=>(other) -> Integer | nil (6107.0)

self と other の継承関係を比較します。

...のクラスやモジュール

//emlist[例][ruby]{
module
Foo
end
class Bar
include
Foo
end
class Baz < Bar
end
class Qux
end
p Bar <=> Foo # => -1
p Baz <=> Bar # => -1
p Baz <=> Foo # => -1
p Baz <=> Qux # => nil
p Qux <=> Baz # => nil

p Baz <=> Object.new # => nil
//}...