るりまサーチ

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

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

クラス

モジュール

検索結果

<< 1 2 > >>

NEWS for Ruby 2.6.0 (26120.0)

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

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

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...ラスの更新

* Array
* 新規メソッド
* Array#union と Array#difference 14097
* 変更されたメソッド
* Array#to_h はブロックを受け取りキーと値のペアを新しいキーと値に変換できるようになりました。 15143
* 別名
*...
...にイテレートする
Enumerator::Chain オブジェクトを返します。 15144
* 変更されたメソッド
* Enumerable#to_h はブロックを受け取りキーと値のペアを新しいキーと値に変換できるようになりました。 15143
* 別名
*...

NEWS for Ruby 2.0.0 (26078.0)

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

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

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...めのメソッドです
* 拡張: Enumerator.new サイズの遅延評価のための引数を一つ受け取るようになりました
* 新規クラス: Enumerator::Lazy 遅延列挙用のクラス

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

* Fiber
* 非...
...GC::Profiler
* 追加: GC::Profiler.raw_data GCの加工していないプロファイルデータを返します

* Hash
* 追加: Hash#to_h 明示的に変換するメソッドです。Array#to_a に似ています
* 拡張: Hash#default_proc= default proc をクリアするため...

NEWS for Ruby 2.1.0 (26030.0)

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

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

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...* 追加: Array#to_h キーと値のペアの配列をハッシュに変換します。

* Binding
* 追加: Binding#local_variable_get
* 追加: Binding#local_variable_set
* 追加: Binding#local_variable_defined?

* Enumerable
* 追加: Enumerable#to_h キーと値のペ...
...ectSpace.#reachable_objects_from_root
* 追加: ObjectSpace.#dump
* 追加: ObjectSpace.#dump_all

* OpenSSL::BN
* 拡張: OpenSSL::BN.new Fixnum や Bignum を引数として取れるようになりました。

* open-uri
* 複数フィールドに同じ名前を使うことを...

Struct#to_h -> Hash (18144.0)

self のメンバ名(Symbol)と値の組を Hash にして返します。

...メンバ名(Symbol)と値の組を Hash にして返します。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_h
# => {:name=>"Joe Smith", :address=>"123 Maple, Anytown NC", :zip=>12345}
//}

ブロックを指定す...
...その結果をペアとして使います。
//emlist[ブロック付きの例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_h {|member, value|
[member, value*2]
} # => {:name=>"Joe SmithJoe Smith", :address=>"123 Maple, Anytown...
...NC123 Maple, Anytown NC", :zip=>24690}
//}

[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。...

Struct#to_h {|member, value| block } -> Hash (18144.0)

self のメンバ名(Symbol)と値の組を Hash にして返します。

...メンバ名(Symbol)と値の組を Hash にして返します。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_h
# => {:name=>"Joe Smith", :address=>"123 Maple, Anytown NC", :zip=>12345}
//}

ブロックを指定す...
...その結果をペアとして使います。
//emlist[ブロック付きの例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_h {|member, value|
[member, value*2]
} # => {:name=>"Joe SmithJoe Smith", :address=>"123 Maple, Anytown...
...NC123 Maple, Anytown NC", :zip=>24690}
//}

[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。...

絞り込み条件を変える

Hash#to_h -> self | Hash (18138.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 {|key, value| block } -> Hash (18138.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 (18131.0)

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

Data#to_h -> Hash (18126.0)

self のメンバ名(Symbol)と値の組を Hash にして返します。

...)と値の組を Hash にして返します。

//emlist[例][ruby]{
Customer = Data.define(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_h
# => {:name=>"Joe Smith", :address=>"123 Maple, Anytown NC", :zip=>12345}
//}

ブロックを指定すると各ペアで...
...として使います。
//emlist[ブロック付きの例][ruby]{
Customer = Data.define(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_h {|member, value|
[member, value*2]
} # => {:name=>"Joe SmithJoe Smith", :address=>"123 Maple, Anytown NC123 Maple, Anytown...

Data#to_h {|member, value| block } -> Hash (18126.0)

self のメンバ名(Symbol)と値の組を Hash にして返します。

...)と値の組を Hash にして返します。

//emlist[例][ruby]{
Customer = Data.define(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_h
# => {:name=>"Joe Smith", :address=>"123 Maple, Anytown NC", :zip=>12345}
//}

ブロックを指定すると各ペアで...
...として使います。
//emlist[ブロック付きの例][ruby]{
Customer = Data.define(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_h {|member, value|
[member, value*2]
} # => {:name=>"Joe SmithJoe Smith", :address=>"123 Maple, Anytown NC123 Maple, Anytown...

絞り込み条件を変える

Struct#to_h -> Hash (18125.0)

self のメンバ名(Symbol)と値の組を Hash にして返します。

...メンバ名(Symbol)と値の組を Hash にして返します。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_h
# => {:name=>"Joe Smith", :address=>"123 Maple, Anytown NC", :zip=>12345}
//}


[注意] 本メソッド...
...の記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。...

OpenStruct#to_h -> { Symbol => object } (18120.0)

self を各要素の名前をキー(Symbol)、要素が値のハッシュに変換して返 します。

...として使います。

//emlist[例][ruby]{
require 'ostruct'
data = OpenStruct.new("country" => "Australia", :capital => "Canberra")
data.to_h # => {:country => "Australia", :capital => "Canberra" }
data.to_h {|name, value| [name.to_s, value.upcase] }
# => {"country" => "AUSTRALIA"...

OpenStruct#to_h {|name, value| block } -> Hash (18120.0)

self を各要素の名前をキー(Symbol)、要素が値のハッシュに変換して返 します。

...として使います。

//emlist[例][ruby]{
require 'ostruct'
data = OpenStruct.new("country" => "Australia", :capital => "Canberra")
data.to_h # => {:country => "Australia", :capital => "Canberra" }
data.to_h {|name, value| [name.to_s, value.upcase] }
# => {"country" => "AUSTRALIA"...

JSON::State#to_h -> Hash (18113.0)

自身をハッシュに変換します。

...自身をハッシュに変換します。

//emlist[例][ruby]{
require "json"
require "pp"

json_state = JSON::State.new
pp json_state.to_h

# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,...

OpenStruct#to_h -> { Symbol => object } (18113.0)

self を各要素の名前をキー(Symbol)、要素が値のハッシュに変換して返 します。

...self を各要素の名前をキー(Symbol)、要素が値のハッシュに変換して返
します。


//emlist[例][ruby]{
require 'ostruct'
data = OpenStruct.new("country" => "Australia", :capital => "Canberra")
data.to_h # => {:country => "Australia", :capital => "Canberra" }
//}...

絞り込み条件を変える

JSON::State#to_hash -> Hash (6113.0)

自身をハッシュに変換します。

...自身をハッシュに変換します。

//emlist[例][ruby]{
require "json"
require "pp"

json_state = JSON::State.new
pp json_state.to_h

# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,...
<< 1 2 > >>