るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 > >>

ARGF.class#eof -> bool (18173.0)

現在開いているファイルがEOFに達したらtrueを返します。そうでない場合は falseを返します。

...イルがEOFに達したらtrueを返します。そうでない場合は
falseを返します。

@
raise IOError ファイルがopenされていない場合に発生します。

$ echo "eof" | ruby argf.rb

ARGF.eof? # => false
3.times { ARGF.readchar }
ARGF.eof?...
...# => false
ARGF.readchar # => "\n"
ARGF.eof? # => true

@
see IO#eof, IO#eof?...

ARGF.class#eof? -> bool (6173.0)

現在開いているファイルがEOFに達したらtrueを返します。そうでない場合は falseを返します。

...イルがEOFに達したらtrueを返します。そうでない場合は
falseを返します。

@
raise IOError ファイルがopenされていない場合に発生します。

$ echo "eof" | ruby argf.rb

ARGF.eof? # => false
3.times { ARGF.readchar }
ARGF.eof?...
...# => false
ARGF.readchar # => "\n"
ARGF.eof? # => true

@
see IO#eof, IO#eof?...

MatchData#byteoffset(name) -> [Integer, Integer] | [nil, nil] (6128.0)

name という名前付きグループに対応する部分文字列のバイト単位のオフセットの 配列 [start, end] を返します。

...返します。

@
param name 名前(シンボルか文字列)

@
raise IndexError 正規表現中で定義されていない name を指定した場合に発生します。

//emlist[例][ruby]{
/(?<year>\d{4})年(?<month>\d{1,2})月(?:(?<day>\d{1,2})日)?/ =~ "2021年1月"
p $~.byteoffset('year')...
...# => [0, 4]
p $~.byteoffset(:year) # => [0, 4]
p $~.byteoffset('month') # => [7, 8]
p $~.byteoffset(:month) # => [7, 8]
p $~.byteoffset('day') # => [nil, nil]
p $~.byteoffset('century') # => `offset': undefined group name reference: century (IndexError)
//}

@
see MatchData#offset...

MatchData#byteoffset(n) -> [Integer, Integer] | [nil, nil] (6123.0)

n 番目の部分文字列のバイト単位のオフセットの 配列 [start, end] を返します。

...のオフセットの
配列 [start, end] を返します。

n番目の部分文字列がマッチしていなければ [nil, nil] を返します。

@
param n 部分文字列を指定する数値

@
raise IndexError 範囲外の n を指定した場合に発生します。

@
see MatchData#offset...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset) -> Symbol (143.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...になります。

@
param source_buffer 変換元文字列のバッファ
@
param destination_buffer 変換先文字列を格納するバッファ
@
param destination_byteoffset 変換先バッファでのオフセット
@
param destination_bytesize 変換先バッファの容量
@
param options 変換...
...の詳細を指定する定数やハッシュ
@
return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output before input...
...e
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished

//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''

begin
ret = ec.primitive_convert(src, dst)
p...

絞り込み条件を変える

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize) -> Symbol (143.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...になります。

@
param source_buffer 変換元文字列のバッファ
@
param destination_buffer 変換先文字列を格納するバッファ
@
param destination_byteoffset 変換先バッファでのオフセット
@
param destination_bytesize 変換先バッファの容量
@
param options 変換...
...の詳細を指定する定数やハッシュ
@
return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output before input...
...e
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished

//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''

begin
ret = ec.primitive_convert(src, dst)
p...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize, options) -> Symbol (143.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...になります。

@
param source_buffer 変換元文字列のバッファ
@
param destination_buffer 変換先文字列を格納するバッファ
@
param destination_byteoffset 変換先バッファでのオフセット
@
param destination_bytesize 変換先バッファの容量
@
param options 変換...
...の詳細を指定する定数やハッシュ
@
return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output before input...
...e
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished

//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''

begin
ret = ec.primitive_convert(src, dst)
p...

ARGF.class#gets(limit, chomp: false) -> String | nil (65.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...す(パラグラフモード)。

@
param limit 最大の読み込みバイト数

@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
AR...
...$ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby...

ARGF.class#gets(rs = $/, chomp: false) -> String | nil (65.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...す(パラグラフモード)。

@
param limit 最大の読み込みバイト数

@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
AR...
...$ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby...

ARGF.class#gets(rs, limit, chomp: false) -> String | nil (65.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...す(パラグラフモード)。

@
param limit 最大の読み込みバイト数

@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
AR...
...$ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby...

絞り込み条件を変える

ARGF.class#gets(limit) -> String | nil (59.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...フモード)。

@
param limit 最大の読み込みバイト数


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt...
...line4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@
see Kernel.#gets, IO#get...

ARGF.class#gets(rs = $/) -> String | nil (59.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...フモード)。

@
param limit 最大の読み込みバイト数


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt...
...line4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@
see Kernel.#gets, IO#get...

ARGF.class#gets(rs, limit) -> String | nil (59.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に
は nil を返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定する...
...フモード)。

@
param limit 最大の読み込みバイト数


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt...
...line4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@
see Kernel.#gets, IO#get...
<< 1 2 3 > >>