るりまサーチ

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

別のキーワード

  1. time parse
  2. parser parse
  3. csv parse
  4. ripper parse
  5. psych parse_stream

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Psych::Parser::Mark#index -> Integer (21102.0)

先頭からの文字数。

先頭からの文字数。

CSV::FieldInfo#index -> Integer (18114.0)

行内で何番目のフィールドかわかるゼロベースのインデックスを返します。

...][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.index
Date.parse(field)
end
p csv.first

# => 0
# => 1
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Date: 2018-07-10...

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

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

...指定します。
@raise IndexError 引数defaultもブロックも与えられてない時、キーの探索に 失敗すると発生します。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::G...
...net/http'

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

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::H...

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

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

...指定します。
@raise IndexError 引数defaultもブロックも与えられてない時、キーの探索に 失敗すると発生します。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::G...
...net/http'

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

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::H...

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

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

...指定します。
@raise IndexError 引数defaultもブロックも与えられてない時、キーの探索に 失敗すると発生します。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::G...
...net/http'

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

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::H...

絞り込み条件を変える

Net::HTTPHeader#form_data=(params) (25.0)

HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。

...URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.form_data = {"q" => ["ruby", "perl"], "lang" => "en"} # => {"q"=>["ruby", "perl"], "lang"=>"en"}
//}

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

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

Net::HTTPHeader#range -> Range|nil (25.0)

Range: ヘッダの示す範囲を Range オブジェクトで返します。

...e 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['range'] = "bytes=1-5"
req.range # => [1..5]
//}

//emlist[例 Net::HTTPHeaderSyntaxError][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP:...

Net::HTTPHeader#set_form_data(params, sep = &#39;&&#39;) -> () (25.0)

HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。

...URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.form_data = {"q" => ["ruby", "perl"], "lang" => "en"} # => {"q"=>["ruby", "perl"], "lang"=>"en"}
//}

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

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

CSV#convert {|field, field_info| ... } (19.0)

引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。

...ue)
csv.convert do |field,field_info|
p field
p field_info
Date.parse(field)
end
p csv.first

# => "2018-07-09"
# => <struct CSV::FieldInfo index=0, line=2, header="date1">
# => "2018-07-10"
# => #<struct CSV::FieldInfo index=1, line=2, header="date2">
# => #<CSV::Row "date1":#<Date: 2018-07-0...

CSV#convert {|field| ... } (19.0)

引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。

...ue)
csv.convert do |field,field_info|
p field
p field_info
Date.parse(field)
end
p csv.first

# => "2018-07-09"
# => <struct CSV::FieldInfo index=0, line=2, header="date1">
# => "2018-07-10"
# => #<struct CSV::FieldInfo index=1, line=2, header="date2">
# => #<CSV::Row "date1":#<Date: 2018-07-0...

絞り込み条件を変える

<< 1 2 3 ... > >>