133件ヒット
[101-133件を表示]
(0.093秒)
別のキーワード
ライブラリ
- ビルトイン (133)
検索結果
-
Module
# >=(other) -> bool | nil (137.0) -
比較演算子。self が other の先祖か同一クラスである場合、 true を返します。 self が other の子孫である場合、false を返します。
...nil を返します。
@param other 比較対象のモジュールやクラス
@raise TypeError other がクラスやモジュールではない場合に発生します。
@see Module#<
//emlist[例][ruby]{
module Foo; end
module Bar
include Foo
end
module Baz
prepend Foo
end
Bar.ancestors... -
Object
# is _ a?(mod) -> bool (131.0) -
オブジェクトが指定されたクラス mod かそのサブクラスのインスタンスであるとき真を返します。
...やModule#prependに
よってサブクラスのインスタンスになる場合も含みます。
上記のいずれでもない場合に false を返します。
@param 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?(Hash) # false
//}
@see Object#instance_of?,Module#===,Object#class... -
Object
# kind _ of?(mod) -> bool (131.0) -
オブジェクトが指定されたクラス mod かそのサブクラスのインスタンスであるとき真を返します。
...やModule#prependに
よってサブクラスのインスタンスになる場合も含みます。
上記のいずれでもない場合に false を返します。
@param 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?(Hash) # false
//}
@see Object#instance_of?,Module#===,Object#class...