るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

モジュール

キーワード

検索結果

Net::HTTP#get(path, header = nil, dest = nil) -> Net::HTTPResponse (18163.0)

サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。

...ist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.html' )

# net/http version 1.2
response = http.get('/index.html')

# compatible in both version
response , = http.get('/index.html')
response.body

# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/'...
..., nil) do |str|
f.write str
end
}
//}

@see Net::HTTP#request_get...

Net::HTTP#get(path, header = nil, dest = nil) {|body_segment| .... } -> Net::HTTPResponse (18163.0)

サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。

...ist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.html' )

# net/http version 1.2
response = http.get('/index.html')

# compatible in both version
response , = http.get('/index.html')
response.body

# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/'...
..., nil) do |str|
f.write str
end
}
//}

@see Net::HTTP#request_get...

OptionParser::Arguable#getopts(short_opt, *long_opt) -> Hash (6131.0)

指定された short_opt や long_opt に応じて自身をパースし、結果を Hash として返します。

...オプションが引数をとる場合は直後に ":" を付けます。

@param long_opt ロングネームのオプション(--version や --bufsize=512)を文字列で指定をします。
オプションが引数をとる場合は後ろに ":" を付けます。...
...ブク
ラスの例外になります。

//emlist[t.rb][ruby]{
require 'optparse'
params = ARGV.getopts("ab:", "foo", "bar:", "bufsize:1024")
p params
//}

# 実行結果
$ ruby t.rb -b 1 --foo --bar xxx -- -a
{"bufsize"=>"1024", "a"=>false, "b"=>"1", "foo"=>true...

Net::HTTPResponse#http_version -> String (6126.0)

サーバがサポートしている HTTP のバージョンを文字列で返します。

...サーバがサポートしている HTTP のバージョンを文字列で返します。

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

uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.http_version # => "1.1"
//}...

REXML::Instruction#target -> String (6119.0)

XML 処理命令のターゲットを返します。

...ットを返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content # =...

絞り込み条件を変える