75件ヒット
[1-75件を表示]
(0.074秒)
ライブラリ
- csv (27)
-
net
/ http (24) -
webrick
/ httprequest (12) -
webrick
/ httpresponse (12)
クラス
- CSV (12)
-
CSV
:: Row (15) -
WEBrick
:: HTTPRequest (12) -
WEBrick
:: HTTPResponse (12)
モジュール
-
Net
:: HTTPHeader (24)
キーワード
-
deconstruct
_ keys (3) - fetch (12)
- shift (12)
-
to
_ hash (12) -
type
_ params (12)
検索結果
先頭5件
-
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__
header1,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...