るりまサーチ

最速Rubyリファレンスマニュアル検索!
252件ヒット [201-252件を表示] (0.100秒)

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. range end

検索結果

<< < 1 2 3 >>

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

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

...

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

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

@
see Module#<

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

module
Prepended
prepend Awesome
end


Include
d.a...
...ncestors # => [Included, Awesome]
Awesome > Included # => true
Include
d > Awesome # => false

Prepended.ancestors # => [Awesome, Prepended]
Awesome > Prepended # => true
Prepended > Awesome # => false

Awesome > Awesome # => false
Awesome > Object # => nil
//}...

Module#>=(other) -> bool | nil (44.0)

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

...を返します。

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

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

@
see Module#<

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

module
Baz
prepend Foo
end


Bar.ancestors # =...

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

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

...her がクラスやモジュールでなければ
nil を返します。

@
param 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 #...

Module#constants(inherit = true) -> [Symbol] (38.0)

そのモジュール(またはクラス)で定義されている定数名の配列を返します。

...の順序は保証されません。

@
param inherit true を指定するとスーパークラスや include したモジュールで
定義された定数が対象にはなります。false を指定した場合 対象にはなりません。

@
see Module.constants, Kernel.#local_variables,...
...variables, Object#instance_variables, Module#class_variables

//emlist[Module.constants と Module#constants の違い][ruby]{
# 出力の簡略化のため起動時の定数一覧を取得して後で差し引く
$clist = Module.constants

class Foo
FOO = 1
end

class Bar
BAR = 1

# Bar は BA...
...ない
p Module.constants - $clist # => [:BAR, :Bar, :Foo]
class Baz
# Baz は定数を含まない
p constants # => []

# ネストしたクラスでは、外側のクラスで定義した定数は
# 参照可能なので、BAR は、Module.constant...

Module#ancestors -> [Class, Module] (32.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...

絞り込み条件を変える

<< < 1 2 3 >>