クラス
-
ARGF
. class (407) - Array (118)
- Binding (6)
- Class (11)
- Complex (33)
- Dir (10)
- Encoding (11)
-
Encoding
:: Converter (66) -
Encoding
:: InvalidByteSequenceError (22) -
Encoding
:: UndefinedConversionError (55) - Enumerator (22)
- Exception (117)
- Fiber (5)
- File (22)
- Float (33)
- IO (951)
- Integer (33)
- Method (11)
- Module (24)
- NilClass (33)
- Numeric (11)
- Object (11)
- Proc (11)
- Rational (315)
- Regexp (11)
-
RubyVM
:: InstructionSequence (119) - SignalException (22)
- StopIteration (11)
- String (174)
- Symbol (32)
- Thread (71)
-
Thread
:: Backtrace :: Location (77) -
Thread
:: ConditionVariable (27) - Time (22)
- TracePoint (17)
- UnboundMethod (11)
モジュール
- Enumerable (55)
キーワード
- * (11)
- ** (11)
- + (11)
- - (11)
- -@ (8)
-
/ (11) - << (11)
- <=> (11)
- == (22)
-
abort
_ on _ exception (11) -
abort
_ on _ exception= (11) - abs (8)
-
absolute
_ path (22) - advise (11)
- backtrace (11)
-
backtrace
_ locations (33) -
base
_ label (22) - binmode (22)
- binmode? (22)
- broadcast (9)
- bytes (7)
- capitalize (16)
- capitalize! (8)
- cause (11)
- ceil (11)
- chars (7)
- chr (11)
- chunk (11)
- clone (11)
- close (11)
-
close
_ on _ exec= (11) -
close
_ on _ exec? (11) -
close
_ read (11) -
close
_ write (11) - codepoints (14)
- coerce (11)
- combination (22)
-
const
_ source _ location (5) - convert (11)
- denominator (11)
-
destination
_ encoding (33) -
destination
_ encoding _ name (22) - disasm (11)
- disassemble (11)
- display (11)
- downcase (16)
- downcase! (8)
- dummy? (11)
- dup (11)
- each (110)
-
each
_ byte (22) -
each
_ char (33) -
each
_ codepoint (22) -
each
_ line (110) - encode (33)
- encode! (22)
- eof (11)
- eof? (11)
-
error
_ char (11) - eval (11)
- exception (22)
-
external
_ encoding (22) - fcntl (11)
- fdatasync (11)
- fdiv (11)
- fileno (21)
-
first
_ lineno (11) - flock (11)
- floor (11)
- fsync (11)
- getbyte (11)
- getc (11)
- gets (66)
- hash (11)
- inspect (44)
-
instruction
_ sequence (6) -
internal
_ encoding (22) - intersection (5)
- ioctl (11)
- label (22)
-
last
_ error (11) - lineno (22)
- lineno= (11)
- lines (42)
- magnitude (8)
-
marshal
_ dump (11) -
module
_ function (19) - negative? (8)
- next (11)
-
next
_ values (11) - numerator (11)
- pack (19)
- partition (33)
- path (24)
- permutation (22)
- pid (11)
- pos (22)
- pos= (22)
- positive? (8)
- pread (7)
-
primitive
_ convert (44) - print (11)
- printf (11)
- priority (11)
- puts (11)
- pwrite (7)
- quo (22)
- raise (5)
-
raised
_ exception (11) - rationalize (99)
- read (22)
-
read
_ nonblock (22) - readbyte (11)
- readchar (11)
- readline (33)
- readlines (66)
- readpartial (22)
- reopen (33)
-
repeated
_ combination (22) -
repeated
_ permutation (22) -
report
_ on _ exception (8) -
report
_ on _ exception= (8) - result (11)
- rewind (11)
- round (11)
- rpartition (11)
- seek (22)
-
set
_ backtrace (11) -
set
_ encoding (66) -
set
_ encoding _ by _ bom (5) - signal (9)
- signm (11)
- signo (11)
-
slice
_ before (22) -
source
_ encoding (11) -
source
_ encoding _ name (11) -
source
_ location (39) - stat (11)
- subsec (11)
- superclass (11)
- swapcase (16)
- swapcase! (8)
- sync (11)
- sync= (11)
- sysread (11)
- sysseek (11)
- syswrite (11)
- tell (22)
-
to
_ a (44) -
to
_ binary (9) -
to
_ f (11) -
to
_ i (22) -
to
_ path (2) -
to
_ r (77) -
to
_ s (33) - truncate (22)
- ungetbyte (11)
- ungetc (11)
- union (6)
- unpack (11)
- upcase (16)
- upcase! (8)
- wait (9)
- write (22)
-
write
_ nonblock (11)
検索結果
先頭5件
- Encoding
:: InvalidByteSequenceError # destination _ encoding _ name -> String - Encoding
:: UndefinedConversionError # destination _ encoding _ name -> String - Rational
# rationalize(eps = 0) -> Rational - Encoding
:: InvalidByteSequenceError # destination _ encoding -> Encoding - Encoding
:: UndefinedConversionError # destination _ encoding -> Encoding
-
Encoding
:: InvalidByteSequenceError # destination _ encoding _ name -> String (21303.0) -
エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
...エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
@see Encoding::InvalidByteSequenceError#destination_encoding... -
Encoding
:: UndefinedConversionError # destination _ encoding _ name -> String (21303.0) -
エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
...エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
@see Encoding::UndefinedConversionError#destination_encoding... -
Rational
# rationalize(eps = 0) -> Rational (18403.0) -
自身から eps で指定した許容誤差の範囲に収まるような Rational を返 します。
...な Rational を返
します。
eps を省略した場合は self を返します。
@param eps 許容する誤差
//emlist[例][ruby]{
r = Rational(5033165, 16777216)
r.rationalize # => (5033165/16777216)
r.rationalize(Rational(0.01)) # => (3/10)
r.rationalize(Rational(0.1))... -
Encoding
:: InvalidByteSequenceError # destination _ encoding -> Encoding (18203.0) -
エラーを発生させた変換の変換先のエンコーディングを Encoding オブジェクトで返します。
...エラーを発生させた変換の変換先のエンコーディングを Encoding
オブジェクトで返します。
@see Encoding::InvalidByteSequenceError#source_encoding,
Encoding::UndefinedConversionError#destination_encoding... -
Encoding
:: UndefinedConversionError # destination _ encoding -> Encoding (18203.0) -
エラーを発生させた変換の変換先のエンコーディングを Encoding オブジェクトで返します。
...エラーを発生させた変換の変換先のエンコーディングを Encoding
オブジェクトで返します。
@see Encoding::UndefinedConversionError#source_encoding... -
IO
# set _ encoding(ext _ enc , int _ enc , **opts) -> self (15331.0) -
IO のエンコーディングを設定します。
...
IO のエンコーディングを設定します。
引数が "A:B" のようにコロンで区切られた文字列の場合は、
A を外部エンコーディング、 B を内部エンコーディングに指定します。
引数が一つで、上のような形式でない場合には、......ーディングを内部エンコーディングに変換する際の
オプションを指定します。
詳しくは String#encode を参照してください。
@param enc_str エンコーディングを表す文字列を指定します。"A:B" のようにコロンで区切られた......xt_enc 外部エンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param int_enc 内部エンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param opts エンコーディング変換のオプション
例:
io =... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (15303.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...xception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if......Date.new(2000, month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.......rb:9:in `get_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
Exception
# exception(error _ message) -> Exception (15303.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセージを表す文字列を指定します。
//emlist[例][ruby]{
begin
# .........# 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end
//}... -
IO
# clone -> IO (15303.0) -
レシーバと同じ IO を参照する新しい IO オブジェクトを返します。 参照しているファイル記述子は dup(2) されます。
...シーバと同じ IO を参照する新しい IO オブジェクトを返します。
参照しているファイル記述子は dup(2) されます。
clone の際に self は一旦 IO#flush されます。
フリーズした IO の clone は同様にフリーズされた IO を返しますが、......しいフリーズされていない IO を返します。
@raise IOError 既に close されていた場合に発生します。
//emlist[例][ruby]{
clone_io = nil
IO.write("testfile", "test")
File.open("testfile") do |io|
clone_io = io.clone
end
clone_io.read # => "test"
clone_io.close
//}... -
IO
# reopen(io) -> self (15272.0) -
自身を指定された io に繋ぎ換えます。
...た io に繋ぎ換えます。
クラスも io に等しくなることに注意してください。
IO#pos, IO#lineno などは指定された io と等しくなります。
@param io 自身を繋ぎ換えたい IO オブジェクトを指定します。
@raise IOError 指定された io が c...