るりまサーチ

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

別のキーワード

  1. openssl public_key
  2. _builtin each_key
  3. openssl public_key=
  4. dbm key
  5. socket pf_key

ライブラリ

クラス

キーワード

検索結果

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

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.upcase, value-32] } # => {"A"=>65, "B"=>66}
//}

@see Enumerable#map...

Hash#to_h -> self | Hash (18151.0)

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.upcase, value-32] } # => {"A"=>65, "B"=>66}
//}

@see Enumerable#map...

NEWS for Ruby 2.0.0 (48.0)

NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

==
1.9.3 以降の変更

==
= 言語仕様の変更

* キーワード引数を追加しました
* %i, %I をシンボルの配列作成のために追加し...
...の引数を一つ受け取るようになりました
* 新規クラス: Enumerator::Lazy 遅延列挙用のクラス

* ENV
* ENV.to_h は ENV.to_hash へのエイリアスです

* Fiber
* 非互換: Fiber#resume は Fiber#transfer を呼び出したファイバーを再開でき...
...ur characters was possible, but accessing the
file afterwards failed. OpenSSL::PKey::RSA, OpenSSL::PKey::DSA and
OpenSSL::PKey::EC therefore now enforce the same check when exporting a
private key to PEM with a password - it has to be at least four characters
long.
* SSL/...

NEWS for Ruby 2.6.0 (48.0)

NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

==
2.5.0 以降の変更

==
= 言語仕様の変更

* $SAFE はプロセスグローバルで扱われることになると共に、0以外を設定した後に0...
...* フリップフロップが非推奨になりました。 5400

==
= 組み込みクラスの更新

* Array
* 新規メソッド
* Array#union と Array#difference 14097
* 変更されたメソッド
* Array#to_h はブロックを受け取りキーと値のペアを新しい...
...Ruby 自体が作成するディスクリプタに FD_CLOEXEC フラグは設定されます。) 14907

* KeyError
* 新規オプション
* KeyError.new に :receiver と :key にオプションが追加されて
Ruby コードからも設定できるようになりました。...