るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

Object#hash -> Integer (156.0)

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

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

2つのオブジェクトのハッシュ値が異なるとき、直ち...
....eql?(B) ならば A.hash == B.hash

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

ただし、ハッシュのキーとして Integer, Symbol, String などの特定の組み込みクラスが使われるときは、組込みのハッシュ関数が使用され、hash メソッドは呼...
...を返します。Ruby 内部の固定長整数 fixnum に収まらない場合は切り捨てられます。

//emlist[][ruby]{
p self.hash #=> 2013505522753096494
p 0.hash #=> 2647535320520409998
p 0.0.hash #=> -2975129765814025835
p nil.hash #=> 2401531420355998067

p "ruby".hash #=> 4460896...

Object#singleton_class -> Class (37.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 (31.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 (31.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 (25.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...

絞り込み条件を変える