るりまサーチ

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

別のキーワード

  1. rake sh
  2. fileutils sh
  3. constants lock_sh
  4. _builtin lock_sh
  5. sync_m sh

ライブラリ

クラス

モジュール

キーワード

検索結果

WEBrick::HTTPRequest#header -> Hash (18202.0)

ヘッダ名をキー、内容をその値とするハッシュを返します。キーも値も文字列です。

ヘッダ名をキー、内容をその値とするハッシュを返します。キーも値も文字列です。

WEBrick::HTTPResponse#header -> Hash (18202.0)

ヘッダ名をキー、ヘッダの値を値とするハッシュを返します。ハッシュのキーも値も文字列です。

ヘッダ名をキー、ヘッダの値を値とするハッシュを返します。ハッシュのキーも値も文字列です。

CSV::Row#to_hash -> Hash (6231.0)

自身をシンプルなハッシュに変換します。

...プルなハッシュに変換します。

フィールドの順序は無視されます。
重複したフィールドは削除されます。

//emlist[例][ruby]{
require "csv"

row = CSV::Row.new(["header2", "header1", "header2"], [1, 2, 3])
row.to_hash # => {"header2"=>3, "header1"=>2}
//}...

CSV#shift -> Array | CSV::Row (3125.0)

String や IO をラップしたデータソースから一行だけ読み込んで フィールドの配列か CSV::Row のインスタンスを返します。

...しない場合は配列を返します。
ヘッダを使用する場合は CSV::Row を返します。

//emlist[例][ruby]{
require "csv"

csv = CSV.new(DATA.read)
csv.readline # => ["header1", "header2"]
csv.readline # => ["row1_1", "row1_2"]

__END__
header
1,header2
row1_1,row1_2
//}...

Net::HTTPHeader#fetch(key) {|hash| .... } -> String (3101.0)

key ヘッダフィールドを返します。

...q.fetch("content-length", "default") # => "default"
//}

//emlist[例 key とブロックを指定][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # => 99
//}

@see Net::HTTPHeader#[]...

絞り込み条件を変える

Net::HTTPHeader#type_params -> Hash (3101.0)

Content-Type のパラメータを {"charset" => "iso-2022-jp"} という形の Hash で返します。

...Content-Type のパラメータを {"charset" => "iso-2022-jp"}
という形の Hash で返します。

Content-Type: ヘッダフィールドが存在しない場合には
空のハッシュを返します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.h...

CSV::Row#deconstruct_keys(keys) -> Hash (155.0)

パターンマッチに使用するヘッダの名前と値の Hash を返します。

...パターンマッチに使用するヘッダの名前と値の Hash を返します。

このメソッドはヘッダ名の型をシンボルに変換しないため、ヘッダ名が文字列かつ Hash パターン でパターンマッチしたい場合はキーをシンボルに変換する...
...ます。

//emlist[例][ruby]{
require "csv"

row = CSV::Row.new([:header1, :header2, :header3], [1, 2, 3])
case row
in { header1: 2.., header2: 2.., header3: 2.. }
puts "all 2 or more"
in { header1: ...2, header2: 2.., header3: 2.. }
puts "first column is less than 2, and rest columns are 2 or...