るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. module included
  2. _builtin included
  3. module included_modules
  4. _builtin included_modules
  5. included _builtin

ライブラリ

クラス

キーワード

検索結果

Module#ancestors -> [Class, Module] (54358.0)

クラス、モジュールのスーパークラスとインクルードしているモジュール を優先順位順に配列に格納して返します。

クラス、モジュールのスーパークラスとインクルードしているモジュール
を優先順位順に配列に格納して返します。

//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
p ancestors
p included_modules
p superclass
end
# => [Baz, Bar, Foo, Object, Kernel, BasicObject]
# => [Foo, Kernel]
# => Bar
//}

@see Module#included_modules
...

Module#included_modules -> [Module] (18358.0)

self にインクルードされているモジュールの配列を返します。

self にインクルードされているモジュールの配列を返します。

//emlist[例][ruby]{
module Mixin
end

module Outer
include Mixin
end

Mixin.included_modules #=> []
Outer.included_modules #=> [Mixin]
//}

@see Module#ancestors

Module#>(other) -> bool | nil (127.0)

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

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

継承関係にないクラス同士の比較では
nil を返します。

@param other 比較対象のモジュールやクラス

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

@see Module#<

//emlist[例][ruby]{
module Awesome; end
module Included
include Awesome
end
module Prepended
...