470件ヒット
[401-470件を表示]
(0.124秒)
ライブラリ
クラス
- Array (84)
- CSV (36)
-
CSV
:: FieldInfo (12) -
Gem
:: Commands :: DependencyCommand (12) - MatchData (26)
- Matrix (24)
-
Net
:: HTTP (84) -
Net
:: HTTPGenericRequest (24) -
Net
:: HTTPResponse (36) -
Prime
:: PseudoPrimeGenerator (48) - StringScanner (24)
モジュール
- Enumerable (24)
-
Net
:: HTTPHeader (36)
キーワード
- begin (12)
-
body
_ stream (12) -
body
_ stream= (12) - byteend (2)
- convert (36)
- each (24)
-
each
_ index (24) -
each
_ with _ index (72) - fetch (72)
-
find
_ gems (12) - get (24)
- get2 (24)
- pointer= (12)
- pos= (12)
-
read
_ body (24) -
request
_ get (24) -
send
_ request (12) - value (12)
-
with
_ index (24)
検索結果
先頭5件
-
MatchData
# begin(n) -> Integer | nil (13.0) -
n 番目の部分文字列先頭のオフセットを返します。
...。
@raise IndexError 範囲外の n を指定した場合に発生します。
//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.begin(0) # => 0
p $~.begin(1) # => 0
p $~.begin(2) # => 3
p $~.begin(3) # => nil
p $~.begin(4) # => `begin': index 4 out of matches (IndexError)
//}......@see MatchData#end... -
Net
:: HTTPGenericRequest # body _ stream -> object (13.0) -
サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。
...RI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
File.open("/path/to/test", 'rb') do |f|
# 大きなファイルを扱う際にメモリ消費を少なくできる
post.body_stream = f
post["Content-Length"] = f.size
end
post.body_stream # => #<File:/pa... -
Net
:: HTTPGenericRequest # body _ stream=(f) (13.0) -
サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。
...RI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
File.open("/path/to/test", 'rb') do |f|
# 大きなファイルを扱う際にメモリ消費を少なくできる
post.body_stream = f
post["Content-Length"] = f.size
end
post.body_stream # => #<File:/pa... -
Net
:: HTTPResponse # value -> nil (13.0) -
レスポンスが 2xx(成功)でなかった場合に、対応する 例外を発生させます。
...が 5xx である場合に発生します。
//emlist[例 レスポンスが 2xx(成功)][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.value # => nil
//}
//emlist[例 レスポンスが 2xx以外][ruby]{
require 'ne......t/http'
uri = "http://www.example.com/invalid.html"
response = Net::HTTP.get_response(URI.parse(uri))
begin
response.value
rescue => e
e.class # => Net::HTTPServerException
e.message # => 404 "Not Found"
end
//}... -
StringScanner
# pointer=(n) (13.0) -
スキャンポインタのインデックスを n にセットします。
...ingScanner.new('test string')
p s.scan(/\w+/) # => "test"
p s.pos = 1 # => 1
p s.scan(/\w+/) # => "est"
p s.pos = 7 # => 7
p s.scan(/\w+/) # => "ring"
begin
s.pos = 20
rescue RangeError => err
puts err #=> index out of range
end
p s.pos = -4 # => -4
p s.scan(/\w+/) # => "ring"
//}... -
StringScanner
# pos=(n) (13.0) -
スキャンポインタのインデックスを n にセットします。
...ingScanner.new('test string')
p s.scan(/\w+/) # => "test"
p s.pos = 1 # => 1
p s.scan(/\w+/) # => "est"
p s.pos = 7 # => 7
p s.scan(/\w+/) # => "ring"
begin
s.pos = 20
rescue RangeError => err
puts err #=> index out of range
end
p s.pos = -4 # => -4
p s.scan(/\w+/) # => "ring"
//}...