168件ヒット
[1-100件を表示]
(0.079秒)
クラス
- CGI (24)
-
CSV
:: Row (36) -
CSV
:: Table (48)
モジュール
-
Net
:: HTTPHeader (60)
キーワード
- []= (36)
-
canonical
_ each (12) -
delete
_ if (12) - each (24)
-
each
_ capitalized (12) -
each
_ header (12) -
each
_ value (12) - out (12)
-
values
_ at (24)
検索結果
先頭5件
-
CGI
# header(options = "text / html") -> String (18150.0) -
HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。 CGI#out を使わずに自力で HTML を出力したい場合などに使います。 このメソッドは文字列エンコーディングを変換しません。
...字列で HTTP ヘッダを生成するための情報を指定します。
例:
header
# Content-Type: text/html
header("text/plain")
# Content-Type: text/plain
header({"nph" => true,
"status" => "OK", # == "200 OK"......e.now + 30,
"cookie" => [cookie1, cookie2],
"my_header1" => "my_value",
"my_header2" => "my_value"})
例:
cgi = CGI.new('html3')
print cgi.header({"charset" => "shift_jis", "status" => "OK"})
print "<html><head><title>TIT... -
Net
:: HTTPHeader # each _ value {|value| . . . . } -> () (9221.0) -
保持しているヘッダの値をブロックに渡し、呼びだします。
...れる文字列は ", " で連結したものです。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_value { |value| puts value }
# => gzip;q=1.0,deflate;q=0.6,identity;q=0.3
# => */*
# => Ruby
//}... -
CSV
:: Table # values _ at(indices _ or _ headers) -> Array (6261.0) -
デフォルトのミックスモードでは、インデックスのリストを与えると行単位の 参照を行い、行の配列を返します。他の方法は列単位の参照と見なします。行 単位の参照では、返り値は行ごとの配列を要素に持つ配列です。
...][ruby]{
require "csv"
row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])
table.values_at(1) # => [#<CSV::Row "header1":"row2_1" "header2":"row2_2">]
//}
//emlist[例 カラムモ......ード][ruby]{
require "csv"
row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])
table.by_col!
table.values_at(1) # => [["row1_2"], ["row2_2"]]
//}
@see CSV::Table#by_col!, CSV::Tab... -
Net
:: HTTPHeader # each _ header {|name , val| . . . . } -> () (6120.0) -
保持しているヘッダ名とその値をそれぞれ ブロックに渡して呼びだします。
...mlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_header { |key,value| puts "#{key} = #{value}" }
# => accept-encoding = gzip;q=1.0,deflate;q=0.6,identity;q=0.3
# => accept = */*
# => user-agent = Ruby
//}... -
CSV
:: Row # values _ at(*headers _ and _ or _ indices) -> Array (3201.0) -
与えられた引数に対応する値の配列を返します。
...与えられた引数に対応する値の配列を返します。
要素の探索に CSV::Row#field を使用しています。
@param headers_and_or_indices ヘッダの名前かインデックスか Range
のインスタンスか第 1 要素がヘッダの名前......るこ
とができます。
@return 引数を与えなかった場合は全ての要素を返します。
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
row = table.first
row.values_at("a", 1, 2..3) # => ["1", "2", "3", nil]... -
Net
:: HTTPHeader # canonical _ each {|name , value| . . . . } -> () (3103.0) -
ヘッダフィールドの正規化名とその値のペアを ブロックに渡し、呼びだします。
ヘッダフィールドの正規化名とその値のペアを
ブロックに渡し、呼びだします。
正規化名は name に対し
name.downcase.split(/-/).capitalize.join('-')
で求まる文字列です。 -
Net
:: HTTPHeader # each _ capitalized {|name , value| . . . . } -> () (3103.0) -
ヘッダフィールドの正規化名とその値のペアを ブロックに渡し、呼びだします。
ヘッダフィールドの正規化名とその値のペアを
ブロックに渡し、呼びだします。
正規化名は name に対し
name.downcase.split(/-/).capitalize.join('-')
で求まる文字列です。 -
Net
:: HTTPHeader # each {|name , val| . . . . } -> () (3020.0) -
保持しているヘッダ名とその値をそれぞれ ブロックに渡して呼びだします。
...mlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_header { |key,value| puts "#{key} = #{value}" }
# => accept-encoding = gzip;q=1.0,deflate;q=0.6,identity;q=0.3
# => accept = */*
# => user-agent = Ruby
//}... -
CSV
:: Row # []=(header _ or _ index , value) (333.0) -
ヘッダの名前かインデックスでフィールドを探し、値をセットします。
...@param header_or_index ヘッダの名前かインデックスを指定します。
@param value 値を指定します。
//emlist[例 ヘッダの名前で指定][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row["header1"] # => "row1_1"
row["header1"] =......"updated"
row["header1"] # => "updated"
//}
//emlist[例 ヘッダの index で指定][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row["header1"] # => "row1_1"
row[0] = "updated"
row["header1"] # => "updated"
//}
//emlist[例 ヘッダの名前と of......e "csv"
row = CSV::Row.new(["header1", "header2", "header1"], ["row1_1", "row1_2", "row1_3"])
row # => #<CSV::Row "header1":"row1_1" "header2":"row1_2" "header1":"row1_3">
row["header1", 1] = "updated"
row # => #<CSV::Row "header1":"row1_1" "header2":"row1_2" "header1":"updated">
//}
@see CSV:...