るりまサーチ

最速Rubyリファレンスマニュアル検索!
60件ヒット [1-60件を表示] (0.072秒)
トップページ > クエリ:Ruby[x] > クエリ:string[x] > クエリ:String[x] > クエリ:Integer[x] > クラス:Object[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. string []=
  2. string slice!
  3. string slice
  4. string []
  5. string gsub!

ライブラリ

キーワード

検索結果

Object#hash -> Integer (157.0)

オブジェクトのハッシュ値を返します。このハッシュ値は、Object#eql? と合わせて Hash クラスで、2つのオブジェクトを同一のキーとするか判定するために用いられます。

...オブジェクトのハッシュ値を返します。このハッシュ値は、Object#eql? と合わせて Hash クラスで、2つのオブジェクトを同一のキーとするか判定するために用いられます。

2つのオブジェクトのハッシュ値が異なるとき、直ち...
...として判定されます。
逆に、2つのハッシュ値が同じとき、さらに Object#eql? での比較により判定されます。
そのため、同じキーとして判定される状況は Object#eql? の比較で真となる場合のみであり、このとき前段階としてハ...
....eql?(B) ならば A.hash == B.hash

の関係が満たされている必要があります。

ただし、ハッシュのキーとして Integer, Symbol, String などの特定の組み込みクラスが使われるときは、組込みのハッシュ関数が使用され、hash メソッドは呼...

Object#singleton_class -> Class (38.0)

レシーバの特異クラスを返します。 まだ特異クラスがなければ、新しく作成します。

...します。

@raise TypeError レシーバが Integer、Float、Symbol の場合に発生します。

//emlist[][ruby]{
Object
.new.singleton_class #=> #<Class:#<Object:0xb7ce1e24>>
String
.singleton_class #=> #<Class:String>
nil.singleton_class #=> NilClass
//}

@see Object#class...

Object#class -> Class (32.0)

レシーバのクラスを返します。

...レシーバのクラスを返します。

//emlist[][ruby]{
p "ruby".class #=> String
p 100.class #=> Integer
p ARGV.class #=> Array
p self.class #=> Object
p Class.class #=> Class
p Kernel.class #=> Module
//}

@see Class#superclass,Object#kind_of?,Object#instance_of?...

Object#public_method(name) -> Method (32.0)

オブジェクトの public メソッド name をオブジェクト化した Method オブジェクトを返します。

...Symbol または String で指定します。
@raise NameError 定義されていないメソッド名や、
protected メソッド名、 private メソッド名を引数として与えると発生します。

//emlist[][ruby]{
1.public_method(:to_int) #=> #<Method: Integer#to_int>
1.public...
..._method(:p) # method `p' for class `Integer' is private (NameError)
//}

@see Object#method,Object#public_send,Module#public_instance_method...

Object#method(name) -> Method (26.0)

オブジェクトのメソッド name をオブジェクト化した Method オブジェクトを返します。

...Stringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。

//emlist[][ruby]{
me = -365.method(:abs)
p me #=> #<Method: Integer#abs>
p me.call #=> 365
//}

@see Module#instance_method, Method, BasicObject#__send__, Object#s...
...end, Kernel.#eval, Object#singleton_method...

絞り込み条件を変える