るりまサーチ (Ruby 2.4.0)

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

別のキーワード

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

ライブラリ

モジュール

検索結果

Enumerable#to_h(*args) -> Hash (63325.0)

self を [key, value] のペアの配列として解析した結果を Hash にして 返します。

self を [key, value] のペアの配列として解析した結果を Hash にして
返します。

@param args each の呼び出し時に引数として渡されます。

//emlist[例][ruby]{
%i[hello world].each_with_index.to_h # => {:hello => 0, :world => 1}
//}

NilClass#to_h -> {} (63325.0)

{} を返します。

{} を返します。

//emlist[例][ruby]{
nil.to_h #=> {}
//}

OpenSSL::X509::Extension#to_h -> Hash (63307.0)

拡張領域の内容を、 { "oid" => 識別子(extnID), "value" => 値(extnValue), "critical" => 重要度(critical) } というハッシュで返します。

拡張領域の内容を、
{ "oid" => 識別子(extnID), "value" => 値(extnValue), "critical" => 重要度(critical) }
というハッシュで返します。

Hash#to_h -> self | Hash (54679.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
//}

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

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

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


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

絞り込み条件を変える

YAML::DBM#to_hash -> Hash (27304.0)

自身のキー、値をハッシュにしたものを返します。

自身のキー、値をハッシュにしたものを返します。

Hash#to_hash -> self (18622.0)

self を返します。

self を返します。

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

@see Object#to_hash, Hash#to_h