4296件ヒット
[1-100件を表示]
(0.138秒)
ライブラリ
- ビルトイン (4296)
クラス
-
ARGF
. class (101) - Array (555)
- BasicObject (33)
- Binding (11)
- Complex (66)
- Data (2)
- Dir (107)
-
Encoding
:: Converter (22) - Enumerator (55)
-
Enumerator
:: Lazy (162) - Exception (95)
- Fiber (29)
- File (123)
-
File
:: Stat (11) - Float (19)
- FrozenError (5)
- Hash (62)
- IO (865)
- Integer (147)
- KeyError (14)
- MatchData (92)
- Module (265)
- Mutex (8)
- Numeric (84)
- Object (165)
- Proc (44)
- Random (44)
- Range (216)
- Rational (77)
- Regexp (11)
- String (311)
- Struct (22)
- SystemCallError (11)
- SystemExit (11)
- Thread (90)
-
Thread
:: Mutex (36) - ThreadGroup (11)
- TracePoint (95)
- UnboundMethod (11)
モジュール
- Comparable (65)
- Enumerable (143)
キーワード
- & (11)
- * (33)
- ** (11)
- + (11)
-
/ (11) - < (22)
- << (11)
- <= (22)
- == (22)
- === (22)
- =~ (22)
- > (22)
- >= (22)
- [] (180)
- []= (110)
- add (11)
- advise (11)
- at (11)
- atime (11)
- backtrace (11)
-
backtrace
_ locations (11) - begin (22)
- between? (11)
- bind (11)
- binmode (11)
- birthtime (21)
- bsearch (44)
- byteindex (2)
- byteoffset (4)
- bytes (14)
- bytesplice (4)
- call (11)
-
callee
_ id (11) - cause (11)
- ceil (11)
- chars (14)
- children (6)
- chmod (11)
- chown (11)
- chr (22)
- chunk (11)
-
chunk
_ while (8) - clamp (10)
-
class
_ variable _ get (11) - clone (22)
- close (15)
-
close
_ read (11) -
close
_ write (11) - coerce (11)
- collect (11)
-
collect
_ concat (11) - combination (22)
-
const
_ get (11) - convert (11)
- ctime (11)
- cycle (22)
-
define
_ method (22) -
delete
_ at (11) -
deprecate
_ constant (9) - detect (22)
- digits (22)
- drop (11)
- dup (22)
- each (110)
-
each
_ byte (22) -
each
_ char (22) -
each
_ child (12) -
each
_ line (66) - end (22)
- entries (6)
-
enum
_ for (44) - eof (22)
- eof? (22)
- errno (11)
-
eval
_ script (6) - event (11)
- exception (22)
- fcntl (11)
- fdatasync (11)
- feed (11)
- fetch (73)
-
fetch
_ values (18) - fileno (32)
- filter (6)
-
filter
_ map (5) - find (22)
-
find
_ all (11) - finish (11)
- first (44)
-
flat
_ map (11) - flatten (11)
- flatten! (11)
- flock (11)
- floor (11)
- flush (11)
- fsync (11)
- gcd (11)
- gcdlcm (11)
- getc (11)
- gets (33)
- include (11)
-
initialize
_ copy (11) - insert (11)
- inspect (22)
-
instance
_ eval (22) -
instance
_ method (11) -
instruction
_ sequence (6) - intersection (5)
- ioctl (11)
- isatty (11)
- join (33)
- key (7)
- last (44)
- lcm (11)
- lineno (22)
- lines (42)
-
local
_ variable _ get (11) - lock (11)
- lstat (11)
- map (11)
-
marshal
_ load (11) - max (86)
- method (11)
-
method
_ id (11) -
method
_ missing (11) - min (86)
- mtime (11)
- name= (9)
- next (11)
-
next
_ values (11) - offset (22)
- ord (11)
- parameters (6)
- path (18)
- peek (11)
-
peek
_ values (11) - permutation (22)
- pid (11)
- pop (22)
- pos (22)
- pow (22)
- pread (7)
- print (11)
- printf (11)
- private (23)
-
private
_ constant (11) - protected (23)
- public (23)
-
public
_ constant (11) -
public
_ instance _ method (11) -
public
_ method (11) -
public
_ send (22) - putc (11)
- puts (11)
- pwrite (7)
- quo (11)
-
raised
_ exception (11) - rand (33)
- rationalize (22)
- read (22)
-
read
_ nonblock (11) - readbyte (22)
- readchar (22)
- readline (66)
- readlines (33)
- readpartial (11)
- receiver (12)
- rehash (11)
- reject (11)
-
remove
_ class _ variable (11) -
remove
_ const (11) -
remove
_ instance _ variable (11) -
remove
_ method (11) - reopen (33)
-
repeated
_ combination (22) -
repeated
_ permutation (22) - replace (11)
-
report
_ on _ exception (8) -
respond
_ to? (11) - resume (11)
-
return
_ value (11) - rewind (22)
- rotate (11)
- rotate! (11)
- round (30)
- run (11)
- sample (44)
- seek (22)
- select (11)
-
set
_ backtrace (11) - setbyte (11)
- shift (22)
-
singleton
_ class (11) -
singleton
_ method (11) - size (11)
- sleep (11)
- slice (66)
- stat (11)
- status (22)
- step (94)
- sync (11)
- synchronize (11)
- sysread (11)
- sysseek (11)
- syswrite (11)
- take (11)
- tell (22)
-
to
_ a (6) -
to
_ enum (44) -
to
_ f (11) -
to
_ i (44) -
to
_ path (7) -
to
_ r (11) -
to
_ s (11) - transfer (3)
- truncate (22)
- tty? (11)
-
undef
_ method (11) - ungetc (11)
-
unicode
_ normalize (10) -
unicode
_ normalize! (10) -
unicode
_ normalized? (10) - unlock (11)
-
values
_ at (11) - wakeup (11)
- with (2)
- write (11)
-
write
_ nonblock (11) - yield (11)
- zip (22)
- | (11)
検索結果
先頭5件
-
Thread
# raise(error _ type , message , traceback) -> () (26226.0) -
自身が表すスレッドで強制的に例外を発生させます。
...させます。
@param error_type Kernel.#raise を参照してください。
@param message Kernel.#raise を参照してください。
@param traceback Kernel.#raise を参照してください。
Thread.new {
sleep 1
Thread.main.raise "foobar"
}
begin
sleep
rescue
p......$!, $@
end
=> #<RuntimeError: foobar>
["-:3"]... -
Fiber
# raise -> object (26216.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...ew { Fiber.yield }
f.resume
f.raise "Error!" # => Error! (RuntimeError)
//}
//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end
p f.resume # => :loop
p f.raise StopIteration # => :exit
//}... -
Fiber
# raise(exception , message = nil , backtrace = nil) -> object (26216.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...ew { Fiber.yield }
f.resume
f.raise "Error!" # => Error! (RuntimeError)
//}
//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end
p f.resume # => :loop
p f.raise StopIteration # => :exit
//}... -
Fiber
# raise(message) -> object (26216.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...ew { Fiber.yield }
f.resume
f.raise "Error!" # => Error! (RuntimeError)
//}
//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end
p f.resume # => :loop
p f.raise StopIteration # => :exit
//}... -
Array
# -(other) -> Array (26119.0) -
自身から other の要素を取り除いた配列を生成して返します。
...変換を試みます。
@raise TypeError 引数に配列以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
[1, 2, 1, 3, 1, 4] - [4, 2] # => [1, 1, 3, 1]
[1, 2, 1, 3, 1, 4] - [1, 4] # => [2, 3]
//}... -
TracePoint
# raised _ exception -> Exception (14219.0) -
発生した例外を返します。
...発生した例外を返します。
@raise RuntimeError :raise イベントのためのイベントフックの外側で実行し
た場合に発生します。
//emlist[例][ruby]{
trace = TracePoint.new(:raise) do |tp|
tp.raised_exception # => #<ZeroDivisionError: divided... -
Encoding
:: Converter # convert(source _ string) -> String (8203.0) -
与えられた文字列を変換して、変換できた結果を返します。 引数の末尾の文字がバイト列の途中で終わっている場合、そのバイト列は変換器内に取り置かれます。 変換を終了させるには Encoding::Converter#finish を呼びます。
...return 変換結果である文字列の一部または全部です。
@raise Encoding::InvalidByteSequenceError 変換元のエンコーディングにおいて不正なバイト列があった場合に発生します。
@raise Encoding::UndefinedConversionError 変換先のエンコーディング......に発生します。
//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "euc-jp")
puts ec.convert("\u3042").dump #=> "\xA4\xA2"
puts ec.finish.dump #=> ""
ec = Encoding::Converter.new("euc-jp", "utf-8")
puts ec.convert("\xA4").dump #=> ""
puts ec.convert("\xA2").dump......= Encoding::Converter.new("utf-8", "iso-2022-jp")
puts ec.convert("\xE3").dump #=> "".force_encoding("ISO-2022-JP")
puts ec.convert("\x81").dump #=> "".force_encoding("ISO-2022-JP")
puts ec.convert("\x82").dump #=> "\e$B$\"".force_encoding("ISO-2022-JP")
puts ec.finish.dump... -
String
# [](range) -> String (8200.0) -
rangeで指定したインデックスの範囲に含まれる部分文字列を返します。
...1 2 3 4 5 (インデックス)
-6 -5 -4 -3 -2 -1 (負のインデックス)
| a | b | c | d | e | f |
|<--------->| 'abcdef'[0..2] # => 'abc'
|<----->| 'abcdef'[4..5] # => 'ef'
|<--------->| 'abcdef'[2..4] # => 'cde'
ra......nge.last が文字列の長さ以上のときは
(文字列の長さ - 1) を指定したものとみなされます。
range.first が 0 より小さいか文字列の長さより大きいときは nil を
返します。ただし range.first および range.last のどちらか
または両方が........ -1] # => "cd" # str[f..-1] は「f 文字目から
'abcd'[ 3 .. -1] # => "d" # 文字列の最後まで」を表す慣用句
'abcd'[ 1 .. 2] # => "bc"
'abcd'[ 2 .. 2] # => "c"
'abcd'[ 3 .. 2] # => ""
'abcd'[ 4 .. 2] # => ""
'abcd'[ 5 .. 2] # => nil
'abcd'[-3 .. 2] # => "bc"
'abcd'[-4... -
String
# slice(range) -> String (8200.0) -
rangeで指定したインデックスの範囲に含まれる部分文字列を返します。
...1 2 3 4 5 (インデックス)
-6 -5 -4 -3 -2 -1 (負のインデックス)
| a | b | c | d | e | f |
|<--------->| 'abcdef'[0..2] # => 'abc'
|<----->| 'abcdef'[4..5] # => 'ef'
|<--------->| 'abcdef'[2..4] # => 'cde'
ra......nge.last が文字列の長さ以上のときは
(文字列の長さ - 1) を指定したものとみなされます。
range.first が 0 より小さいか文字列の長さより大きいときは nil を
返します。ただし range.first および range.last のどちらか
または両方が........ -1] # => "cd" # str[f..-1] は「f 文字目から
'abcd'[ 3 .. -1] # => "d" # 文字列の最後まで」を表す慣用句
'abcd'[ 1 .. 2] # => "bc"
'abcd'[ 2 .. 2] # => "c"
'abcd'[ 3 .. 2] # => ""
'abcd'[ 4 .. 2] # => ""
'abcd'[ 5 .. 2] # => nil
'abcd'[-3 .. 2] # => "bc"
'abcd'[-4... -
Integer
# **(other) -> Numeric (8173.0) -
算術演算子。冪(べき乗)を計算します。
...@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -......2) # => -1
-3.pow(3, 8) # => 5
-3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}
結果が巨大すぎる整数になりそうなとき、警告を出したうえで Float::INFINITY を返します。
//emlist[計算を放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning:... -
Integer
# pow(other) -> Numeric (8173.0) -
算術演算子。冪(べき乗)を計算します。
...@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -......2) # => -1
-3.pow(3, 8) # => 5
-3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}
結果が巨大すぎる整数になりそうなとき、警告を出したうえで Float::INFINITY を返します。
//emlist[計算を放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning:...