るりまサーチ

最速Rubyリファレンスマニュアル検索!
66件ヒット [1-66件を表示] (0.044秒)
トップページ > クエリ:new[x] > クエリ:is_a?[x]

別のキーワード

  1. rake is_a?
  2. object is_a?
  3. filelist is_a?
  4. _builtin is_a?
  5. socket cmsg_is?

ライブラリ

クラス

キーワード

検索結果

Object#is_a?(mod) -> bool (18106.0)

オブジェクトが指定されたクラス mod かそのサブクラスのインスタンスであるとき真を返します。

...です。

//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...

Rake::FileList#is_a?(klass) -> bool (18106.0)

自身に Array のフリをさせます。

...自身に Array のフリをさせます。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new("test1.rb", "test2.rb", "test3.rb")
file_list.is_a?(Array) # => true
file_list.is_a?(String) # => false
end
//}...

Object#kind_of?(mod) -> bool (3006.0)

オブジェクトが指定されたクラス mod かそのサブクラスのインスタンスであるとき真を返します。

...です。

//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...

Rake::FileList#kind_of?(klass) -> bool (3006.0)

自身に Array のフリをさせます。

...自身に Array のフリをさせます。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new("test1.rb", "test2.rb", "test3.rb")
file_list.is_a?(Array) # => true
file_list.is_a?(String) # => false
end
//}...

Ruby用語集 (12.0)

Ruby用語集 A B C D E F G I J M N O R S Y

...by から。

参照:irb

: is-a 関係
Ruby では Object#is_a? で確認できる関係。

たとえば、配列オブジェクトは Array クラスや Enumerable モジュール、Object クラス
などに対して is_a? の関係にある。

: ISO/IEC 30170
JIS X 3017 の原規...
...ことができる。

このような意味でオブジェクトが特定のクラスやモジュールの表す型に
属すことは Object#is_a? メソッドで確認できる。

さらには、特定の名前のメソッド(群)が呼び出し可能であることを型と
みな...
...文字としては特別扱いされない。
ただしパス名には使えず、ヌル文字を含んだ文字列を File.open や
Pathname.new に与えると ArgumentError が発生する。

他の言語では文字列の終端を意味することがあるので、文字列データ...

絞り込み条件を変える

irb/completion (12.0)

irb の completion 機能を提供するライブラリです。

...d instance_of?
initialize install_aliases instance_variables
irb(main):001:0> inspect
"main"
irb(main):002:0> foo = Object.new
#<Object:0x4027146c>

"変数名." の後に [Tab] を押すと, そのオブジェクトのメソッド一覧がでます.

irb(main):003:0> f...
....class foo.instance_of? foo.taint
foo.clone foo.instance_variables foo.tainted?
foo.display foo.is_a? foo.to_a
foo.dup foo.kind_of? foo.to_s
foo.eql? foo.method foo.type
foo...