るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

IO#pos -> Integer (18119.0)

ファイルポインタの現在の位置を整数で返します。

...タの現在の位置を整数で返します。

@raise IOError 既に close されている場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "This is line one\n")
File.open("testfile") do |f|
f.pos # => 0
f.gets # => "This is line one\n"
f.pos # => 17
end
//}...

Dir#pos -> Integer (18113.0)

ディレクトリストリームの現在の位置を整数で返します。

...ディレクトリストリームの現在の位置を整数で返します。

@raise IOError 既に自身が close している場合に発生します。

//emlist[例][ruby]{
Dir.open("/tmp") {|d|
d.each {|f|
p d.pos
}
}
//}...

StringScanner#pos -> Integer (15131.0)

現在のスキャンポインタのインデックスを返します。

...デックスを返します。

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

s = StringScanner.new('test string')
s.pos # => 0
s.scan(/\w+/) # => "test"
s.pos # => 4
s.scan(/\w+/) # => nil
s.pos # => 4
s.scan(/\s+/) # => " "
s.pos # => 5
//}

@see StringScanner#charpos...

Dir#pos=(pos) (6247.0)

ディレクトリストリームの読み込み位置を pos に移動させます。 pos は Dir#tell で与えられた値でなければなりま せん。

...み込み位置を pos に移動させます。
pos
は Dir#tell で与えられた値でなければなりま
せん。

@param pos 変更したい位置を整数で与えます。

@raise IOError 既に自身が close している場合に発生します。

//emlist[例][ruby]{
Dir.open("testdir"...

Net::HTTP#post(path, data, header = nil, dest = nil) -> Net::HTTPResponse (6124.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。

...サーバ上の path にあるエンティティに対し文字列 data を
POS
T で送ります。

返り値は Net::HTTPResponse のインスタンスです。

ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与え...
...ます。このとき戻り値の HTTPResponse オブジェクトは有効な body を
持ちません。

POS
T する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlen...
...す。

//emlist[例][ruby]{
# net/http version 1.1
response, body = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')

# version 1.2
response = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')

# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-bin/search.rb', '...

絞り込み条件を変える

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

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。

...サーバ上の path にあるエンティティに対し文字列 data を
POS
T で送ります。

返り値は Net::HTTPResponse のインスタンスです。

ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与え...
...ます。このとき戻り値の HTTPResponse オブジェクトは有効な body を
持ちません。

POS
T する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlen...
...す。

//emlist[例][ruby]{
# net/http version 1.1
response, body = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')

# version 1.2
response = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')

# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-bin/search.rb', '...

IO#pos=(n) (6119.0)

ファイルポインタを指定位置に移動します。 IO#seek(n, IO::SEEK_SET) と同じです。

...ットを整数で指定します。

@raise IOError 既に close されている場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
File.open("testfile") do |f|
f.pos # => 0
f.pos = 17
f.gets # => "This is line two\n"
end
//}...

StringScanner#charpos -> Integer (6118.0)

現在のスキャンポインタのインデックスを文字単位で返します。

...キャンポインタのインデックスを文字単位で返します。

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

s = StringScanner.new("abcädeföghi")
s.charpos # => 0
s.scan_until(/ä/) # => "abcä"
s.pos # => 5
s.charpos # => 4
//}

@see StringScanner#pos...

StringIO#pos=(n) (6113.0)

自身の位置を n に移動します。自身が表す文字列のサイズより大きくても構いません。

...@param n 自身の位置を整数で指定します。

@raise Errno::EINVAL n がマイナスである場合に発生します。

//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge", 'r+')
a.pos = 10
a << 'Z'
a.string #=> "hoge\000\000\000\000\000\000Z"
//}...
<< 1 2 3 ... > >>