るりまサーチ

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

別のキーワード

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

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

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

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

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

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

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

...t[例][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", "capital" => "CANBERRA" }
//}...

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

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

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

ブロックを指定すると各要素でブロックを呼び出し、
その結果をペアとして使います。

//emlist[ブロック付きの例][ruby]{
(1..5).to_h {|x| [x, x ** 2]} # => {1=>1, 2=>4, 3=>...

Enumerable#to_h(*args) { ... } -> Hash (21115.0)

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

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

ブロックを指定すると各要素でブロックを呼び出し、
その結果をペアとして使います。

//emlist[ブロック付きの例][ruby]{
(1..5).to_h {|x| [x, x ** 2]} # => {1=>1, 2=>4, 3=>...

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

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

...t[例][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", "capital" => "CANBERRA" }
//}...

絞り込み条件を変える

Enumerable#to_h(*args) -> Hash (21108.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}
//}...

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

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

...e "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,
# :max_nesting=>100,
# :depth=>0,
# :buffer_initial_length=>...

NilClass#to_h -> {} (21108.0)

{} を返します。

...{} を返します。

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

OpenStruct#to_h -> { Symbol => object } (21108.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 (9108.0)

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

...e "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,
# :max_nesting=>100,
# :depth=>0,
# :buffer_initial_length=>...

絞り込み条件を変える

Rake::TaskArguments#to_hash -> Hash (9101.0)

パラメータ名と対応する値を格納したハッシュを返します。

...納したハッシュを返します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
arguments = Rake::TaskArguments.new(["name1", "name2"], ["value1", "value2"])
arguments.to_hash # => {:name1=>"value1", :name2=>"value2"}
end
//}...

Enumerable#collect -> Enumerator (3119.0)

各要素に対してブロックを評価した結果を全て含む配列を返します。

...配列を返します。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# すべて 3 倍にした配列を返す
p (1..3).map {|n| n * 3 } # => [3, 6, 9]
p (1..3).collect { "cat" } # => ["cat", "cat", "cat"]
//}

@see Hash#to_h, Array#collect, Array#map...

Enumerable#map -> Enumerator (3119.0)

各要素に対してブロックを評価した結果を全て含む配列を返します。

...配列を返します。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# すべて 3 倍にした配列を返す
p (1..3).map {|n| n * 3 } # => [3, 6, 9]
p (1..3).collect { "cat" } # => ["cat", "cat", "cat"]
//}

@see Hash#to_h, Array#collect, Array#map...
<< 1 2 > >>