るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. rdoc/require require

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

CSV::FieldInfo#header -> String | nil (24321.0)

利用可能な場合はヘッダを表す文字列を返します。

...字列を返します。

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

csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field_info.header
Date.parse(field)
end
p csv.first

# => "date1"
# => "date2"
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309...

URI::MailTo#headers -> [[String]] (12320.0)

自身のヘッダーを文字列の配列の配列として設定します。

...自身のヘッダーを文字列の配列の配列として設定します。

例:
require
'uri'
m = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
p m.headers #=> [["subject", "subscribe"], ["cc", "myaddr"]]...

Net::HTTPHeader#proxy_basic_auth(account, password) -> [String] (9214.0)

Proxy 認証のために Proxy-Authorization: ヘッダをセットします。

...Proxy 認証のために Proxy-Authorization: ヘッダをセットします。

@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html...
...')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.proxy_basic_auth("account", "password") # => ["Basic YWNjb3VudDpwYXNzd29yZA=="]
//}...

Net::HTTPHeader#fetch(key) -> String (6258.0)

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

...す。
key は大文字小文字を区別しません。

@param key ヘッダフィール名を文字列で与えます。
@param default 該当するキーが登録されていない時の返り値を指定します。
@raise IndexError 引数defaultもブロックも与えられてない時、キ...
...する][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.fetch("user-agent") # => "Ruby"
//}

//emlist[例 key のみ指定。key が存在しない][ruby]{
require
'net/http'

begin
r
eq.fetch("content-length")
r
escue =>...
...e
e # => #<KeyError: key not found: "content-length">
end
//}

//emlist[例 key , default を指定][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.fetch("content-length", "default") # => "default"
//}

//emlist[例 key...

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

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

...す。
key は大文字小文字を区別しません。

@param key ヘッダフィール名を文字列で与えます。
@param default 該当するキーが登録されていない時の返り値を指定します。
@raise IndexError 引数defaultもブロックも与えられてない時、キ...
...する][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.fetch("user-agent") # => "Ruby"
//}

//emlist[例 key のみ指定。key が存在しない][ruby]{
require
'net/http'

begin
r
eq.fetch("content-length")
r
escue =>...
...e
e # => #<KeyError: key not found: "content-length">
end
//}

//emlist[例 key , default を指定][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.fetch("content-length", "default") # => "default"
//}

//emlist[例 key...

絞り込み条件を変える

Net::HTTPHeader#fetch(key, default) -> String (6258.0)

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

...す。
key は大文字小文字を区別しません。

@param key ヘッダフィール名を文字列で与えます。
@param default 該当するキーが登録されていない時の返り値を指定します。
@raise IndexError 引数defaultもブロックも与えられてない時、キ...
...する][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.fetch("user-agent") # => "Ruby"
//}

//emlist[例 key のみ指定。key が存在しない][ruby]{
require
'net/http'

begin
r
eq.fetch("content-length")
r
escue =>...
...e
e # => #<KeyError: key not found: "content-length">
end
//}

//emlist[例 key , default を指定][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.fetch("content-length", "default") # => "default"
//}

//emlist[例 key...

CSV#row_sep -> String (6238.0)

行区切り文字列として使用する文字列を返します。

...行区切り文字列として使用する文字列を返します。

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

csv = CSV.new("header1,header2|row1_1,row1_2", row_sep: "|")
csv.row_sep # => "|"
csv.read # => [["header1", "header2"], ["row1_1", "row1_2"]]
//}

@see CSV.new...

CSV#quote_char -> String (6226.0)

フィールドをクオートするのに使用する文字列を返します。

...フィールドをクオートするのに使用する文字列を返します。

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

csv = CSV.new("header1,header2\nrow1_1,row1_2", quote_char: "'")
csv.quote_char # => "'"
//}

@see CSV.new...

Net::HTTPHeader#[](key) -> String|nil (6220.0)

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

...す。キーが存在しなければ nil を返します。

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

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq['user-agent'] # => Ruby
//}

一種類のヘッダフィールドが一つのヘッダの中に複...
...存在する
場合にはそれを全て ", " で連結した文字列を返します。
key は大文字小文字を区別しません。

@param key ヘッダフィール名を文字列で与えます。

@see Net::HTTPHeader#[]=,
Net::HTTPHeader#add_field,
Net::HTTPHeader#get_fields...
<< 1 2 3 ... > >>