るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

モジュール

キーワード

検索結果

<< < 1 2 3 4 5 ... > >>

Range#cover?(obj) -> bool (8013.0)

obj が範囲内に含まれている時に true を返します。

...数値については、例外として Range#include? も連続的に扱います。)

Range#exclude_end?がfalseなら「begin <= obj <= end」を、
trueなら「begin <= obj < end」を意味します。

@param obj 比較対象のオブジェクトを指定します。

//emlist[数値は連...

Regexp#fixed_encoding? -> bool (8013.0)

正規表現が任意の ASCII 互換エンコーディングとマッチ可能な時に false を返します。

...# => true
r.encoding # => #<Encoding:UTF-8>
r =~ "\u{6666} a" # => 2
begin

r =~ "\xa1\xa2".force_encoding("euc-jp")
rescue => e
e.class # => Encoding::CompatibilityError
end
r =~...
...# => true
r.encoding # => #<Encoding:UTF-8>
r =~ "\u{6666} a" # => 0
begin

r =~ "\xa1\xa2".force_encoding("euc-jp")
rescue => e
e.class # => Encoding::CompatibilityError
end
r =~...

SystemCallError#errno -> Integer | nil (8013.0)

レシーバに対応するシステム依存のエラーコードを返します。

...ドを渡さない形式で生成した場合は nil を返します。

begin

raise Errno::ENOENT
rescue Errno::ENOENT => err
p err.errno # => 2
p Errno::ENOENT::Errno # => 2
end

begin

raise SystemCallError, 'message'
rescue SystemCallError => err...

SystemExit#status -> Integer (8013.0)

例外オブジェクトに保存された終了ステータスを返します。

...します。

終了ステータスは Kernel.#exit や SystemExit.new などで設定されます。

例:

begin

exit 1
rescue SystemExit => err
p err.status # => 1
end

begin

raise SystemExit.new(1, "dummy exit")
rescue SystemExit => err
p err.status # => 1
end...

SystemExit#success? -> bool (8013.0)

終了ステータスが正常終了を示す値ならば true を返します。

...値ならば true を返します。

大半のシステムでは、ステータス 0 が正常終了を表します。

例:

begin

exit true
rescue SystemExit => err
p err.success? # => true
end

begin

exit false
rescue SystemExit => err
p err.success? # => false
end...

絞り込み条件を変える

Array#fetch(nth) -> object (8007.0)

nth 番目の要素を返します。

...ておらず、 nth 番目の要
素も存在しなかった場合に発生します。

//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin

p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end

p a.fetch(10, 999) #=> 999

result = a.fetch(10){|nth|
print...

Array#fetch(nth) {|nth| ... } -> object (8007.0)

nth 番目の要素を返します。

...ておらず、 nth 番目の要
素も存在しなかった場合に発生します。

//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin

p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end

p a.fetch(10, 999) #=> 999

result = a.fetch(10){|nth|
print...

Array#fetch(nth, ifnone) -> object (8007.0)

nth 番目の要素を返します。

...ておらず、 nth 番目の要
素も存在しなかった場合に発生します。

//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin

p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end

p a.fetch(10, 999) #=> 999

result = a.fetch(10){|nth|
print...

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

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

...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 [ret, src, dst, ec.primitive_errinfo]
case ret
when :invalid_byte_sequence
ec.insert_output(ec...

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

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

...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 [ret, src, dst, ec.primitive_errinfo]
case ret
when :invalid_byte_sequence
ec.insert_output(ec...

絞り込み条件を変える

<< < 1 2 3 4 5 ... > >>