るりまサーチ

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

別のキーワード

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

キーワード

検索結果

<< < ... 32 33 34 35 36 ... > >>

CSV::Converters -> Hash (12.0)

このハッシュは名前でアクセスできる組み込みの変換器を保持しています。

...ールドを変換します。
: :numeric
:integer と :float の組み合わせです。
: :date
Date.parse を使用してフィールドを変換します。
: :date_time
DateTime.parse を使用してフィールドを変換します。
: :all
:date_time と :numeric の組み合わせ...

JSON.[](object, options) -> object (12.0)

文字列のように扱えるデータを受け取った場合は Ruby のオブジェクトに変換して返します。 そうでない場合は JSON に変換して返します。

...そうでない場合は JSON に変換して返します。

@param object 任意のオブジェクト指定可能です。

@param options JSON.#parse, JSON.#generate の説明を参照してください。

//emlist[例][ruby]{
require "json"
string=<<JSON
{ "a":1, "b":2, "c":3 }
JSON
hash = { a...
...# => Hash
JSON[string] # => {"a"=>1, "b"=>2, "c"=>3}
JSON[string, symbolize_names: true] # => {:a=>1, :b=>2, :c=>3}
JSON[hash].class # => String
JSON[hash] # => "{\"a\":1,\"b\":2,\"c\":3}"
//}

@see JSON.#parse, JSON.#generate...

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

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

...et/http'

uri = 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.exampl...

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

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

...][ruby]{
require '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')
r...

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

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

...et/http'

uri = 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.exampl...

絞り込み条件を変える

Net::HTTPResponse#read_body {|str| .... } -> () (12.0)

ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。

....example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.read_body[0..10] # => "<!doctype h"
//}

//emlist[例2 ブロックを与えて大きいファイルを取得][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/path/to/big.file')
Net::HTTP.start(uri...

Net::HTTPResponse#read_body(dest=nil) -> String|nil (12.0)

ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。

....example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.read_body[0..10] # => "<!doctype h"
//}

//emlist[例2 ブロックを与えて大きいファイルを取得][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/path/to/big.file')
Net::HTTP.start(uri...

Net::HTTPResponse#value -> nil (12.0)

レスポンスが 2xx(成功)でなかった場合に、対応する 例外を発生させます。

.../index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.value # => nil
//}

//emlist[例 レスポンスが 2xx以外][ruby]{
require 'net/http'

uri = "http://www.example.com/invalid.html"
response = Net::HTTP.get_response(URI.parse(uri))
begin
response.value
rescue => e
e.class...

OpenURI.open_uri(name, mode = &#39;r&#39;, perm = nil, options = {}) -> StringIO (12.0)

URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。

...えます。
//emlist{
文字列: "http://proxy.example.com:8000/" のようなプロクシの URI。
URI オブジェクト: URI.parse("http://proxy.example.com:8000/") のようなプロクシの URI オブジェクト。
true: Proxy を環境変数などから見つ...
...tp_basic_authentication =>
["http://proxy.example.com:8000/", "proxy-user", "proxy-password"]
:proxy_http_basic_authentication =>
[URI.parse("http://proxy.example.com:8000/"), "proxy-user", "proxy-password"]
//}

: :read_timeout
http コネクションのタイムアウト秒数を指...

OpenURI.open_uri(name, mode = &#39;r&#39;, perm = nil, options = {}) {|sio| ... } -> nil (12.0)

URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。

...えます。
//emlist{
文字列: "http://proxy.example.com:8000/" のようなプロクシの URI。
URI オブジェクト: URI.parse("http://proxy.example.com:8000/") のようなプロクシの URI オブジェクト。
true: Proxy を環境変数などから見つ...
...tp_basic_authentication =>
["http://proxy.example.com:8000/", "proxy-user", "proxy-password"]
:proxy_http_basic_authentication =>
[URI.parse("http://proxy.example.com:8000/"), "proxy-user", "proxy-password"]
//}

: :read_timeout
http コネクションのタイムアウト秒数を指...

絞り込み条件を変える

<< < ... 32 33 34 35 36 ... > >>