るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

検索結果

Hash#to_h -> self | Hash (24367.0)

self を返します。Hash クラスのサブクラスから呼び出した場合は self を Hash オブジェクトに変換します。

...
self
を返します。Hash クラスのサブクラスから呼び出した場合は
self
Hash オブジェクトに変換します。

//emlist[例][ruby]{
hash
= {}
p hash.to_h # => {}
p hash.to_h == hash # => true

class MyHash < Hash;end
my_hash = MyHash.new
p my_hash.to_h # =>...
...{}
p my_hash.class # => MyHash
p my_hash.to_h.class # => Hash
//}...
...{}
p my_hash.class # => MyHash
p my_hash.to_h.class # => Hash
//}

ブロックを指定すると各ペアでブロックを呼び出し、
その結果をペアとして使います。
//emlist[ブロック付きの例][ruby]{
hash
= { "a" => 97, "b" => 98 }
hash
.to_h {|key, value| [key.upc...

Hash#to_h {|key, value| block } -> Hash (24267.0)

self を返します。Hash クラスのサブクラスから呼び出した場合は self を Hash オブジェクトに変換します。

...
self
を返します。Hash クラスのサブクラスから呼び出した場合は
self
Hash オブジェクトに変換します。

//emlist[例][ruby]{
hash
= {}
p hash.to_h # => {}
p hash.to_h == hash # => true

class MyHash < Hash;end
my_hash = MyHash.new
p my_hash.to_h # =>...
...{}
p my_hash.class # => MyHash
p my_hash.to_h.class # => Hash
//}

ブロックを指定すると各ペアでブロックを呼び出し、
その結果をペアとして使います。
//emlist[ブロック付きの例][ruby]{
hash
= { "a" => 97, "b" => 98 }
hash
.to_h {|key, value| [key.upc...

Hash#to_hash -> self (12325.0)

self を返します。

...
self
を返します。

//emlist[例][ruby]{
hash
= {}
p hash.to_hash # => {}
p hash.to_hash == hash # => true
//}

@see Object#to_hash, Hash#to_h...