ライブラリ
- ビルトイン (9073)
-
shell
/ command-processor (6)
クラス
-
ARGF
. class (141) - Array (513)
- Bignum (33)
- Binding (6)
- Class (11)
- Complex (110)
- Data (36)
- Dir (342)
- Encoding (99)
-
Encoding
:: Converter (132) -
Encoding
:: InvalidByteSequenceError (22) -
Encoding
:: UndefinedConversionError (22) - Enumerator (194)
-
Enumerator
:: ArithmeticSequence (84) -
Enumerator
:: Chain (36) -
Enumerator
:: Lazy (389) -
Enumerator
:: Yielder (27) - Exception (11)
- File (590)
-
File
:: Stat (473) - Fixnum (30)
- Float (614)
- Hash (243)
- IO (387)
- Integer (122)
- LoadError (11)
- MatchData (268)
- Method (11)
- Module (200)
- NilClass (44)
- NoMethodError (8)
- Numeric (182)
- Object (134)
- Proc (16)
-
Process
:: Status (165) -
Process
:: Tms (44) - Random (88)
- Range (67)
- Rational (315)
- Regexp (63)
- RubyVM (1)
-
RubyVM
:: InstructionSequence (62) -
Shell
:: CommandProcessor (6) - StopIteration (11)
- String (387)
- Struct (50)
- Symbol (19)
- SyntaxError (2)
- SystemExit (22)
- Thread (93)
-
Thread
:: Backtrace :: Location (77) - Time (113)
- TracePoint (21)
- UnboundMethod (11)
モジュール
- Enumerable (496)
-
File
:: Constants (44) - FileTest (22)
- GC (66)
-
GC
:: Profiler (22) - Kernel (377)
- Math (319)
- ObjectSpace (33)
- Process (84)
-
RubyVM
:: AbstractSyntaxTree (8) - Warning (16)
キーワード
-
$ ? (11) -
$ LOADED _ FEATURES (11) -
$ LOAD _ PATH (11) -
$ ~ (11) - % (29)
- & (11)
- * (28)
- ** (28)
- + (34)
- - (39)
- -@ (19)
-
/ (28) - < (11)
- << (11)
- <= (11)
- <=> (33)
- == (52)
- === (5)
- > (11)
- >= (11)
- >> (11)
-
ALT
_ SEPARATOR (11) - ArgumentError (11)
- ArithmeticSequence (6)
- CREAT (11)
- Chain (6)
- CompatibilityError (11)
- DATA (11)
- DIG (11)
- Data (8)
- DomainError (11)
- E (11)
- ENOATTR (11)
- ENODATA (11)
- EPROGMISMATCH (11)
- EPSILON (11)
- ERPCMISMATCH (11)
- EUNATCH (11)
- Enumerator (11)
-
FNM
_ DOTMATCH (11) -
FNM
_ PATHNAME (11) - Float (22)
- FloatDomainError (11)
- INFINITY (11)
- Lazy (11)
- Location (11)
- MACCROATIAN (11)
-
MANT
_ DIG (11) - MAX (11)
-
MAX
_ 10 _ EXP (11) -
MAX
_ EXP (11) - MIN (11)
-
MIN
_ 10 _ EXP (11) -
MIN
_ EXP (11) - MacCroatian (11)
- MatchData (11)
- Math (11)
- NAN (11)
- NOATIME (11)
- NoMatchingPatternError (5)
-
PATH
_ SEPARATOR (11) - PI (11)
- RADIX (11)
-
RLIMIT
_ DATA (11) - ROUNDS (7)
-
RUBY
_ PATCHLEVEL (11) -
RUBY
_ PLATFORM (11) -
RUBY
_ RELEASE _ DATE (11) - Rational (22)
-
SEEK
_ DATA (11) - SEPARATOR (11)
-
STATELESS
_ ISO _ 2022 _ JP (11) -
STATELESS
_ ISO _ 2022 _ JP _ KDDI (11) - Separator (11)
- Stat (11)
-
Stateless
_ ISO _ 2022 _ JP (11) -
Stateless
_ ISO _ 2022 _ JP _ KDDI (11) - Status (11)
- StopIteration (11)
- Yielder (11)
- [] (108)
- []= (5)
-
abort
_ on _ exception= (22) - abs (19)
-
absolute
_ path (33) -
absolute
_ path? (5) - acos (11)
- acosh (11)
- all? (13)
- allocate (11)
- angle (33)
- any? (14)
-
append
_ features (11) - arg (33)
-
ascii
_ compatible? (11) -
asciicompat
_ encoding (22) - asin (11)
- asinh (11)
-
at
_ exit (11) - atan (11)
- atan2 (11)
- atanh (11)
- atime (33)
- attr (33)
-
attr
_ accessor (11) -
attr
_ reader (11) -
attr
_ writer (11) - autoload (22)
-
backtrace
_ locations (33) -
base
_ label (11) - begin (17)
- binread (11)
- binwrite (11)
- birthtime (11)
- blksize (11)
- blockdev? (22)
- blocks (11)
- bsearch (22)
-
bsearch
_ index (9) - byteindex (2)
- byteoffset (4)
- byterindex (2)
- bytes (14)
- caller (33)
-
caller
_ locations (22) - captures (11)
- catch (22)
- cbrt (11)
- ceil (26)
- chain (6)
- chardev? (22)
- chars (14)
- chdir (33)
- children (14)
- chroot (11)
- chunk (33)
-
chunk
_ while (19) -
clock
_ gettime (11) - codepoints (14)
- coerce (11)
- collect (33)
- collect! (11)
-
collect
_ concat (33) - combination (22)
- compact (3)
- compatible? (11)
- compile (11)
- concat (38)
- conjugate (22)
-
const
_ source _ location (5) - convert (11)
- convpath (11)
- coredump? (11)
- cos (11)
- cosh (11)
- cstime (11)
- ctime (11)
- cutime (11)
- cycle (22)
- deconstruct (2)
-
deconstruct
_ keys (2) -
def
_ builtin _ commands (6) - define (4)
- delete (11)
-
delete
_ at (11) -
delete
_ if (33) - denominator (55)
-
deprecate
_ constant (9) -
destination
_ encoding (33) -
destination
_ encoding _ name (22) - detect (11)
- dev (11)
-
dev
_ major (11) -
dev
_ minor (11) - directory? (22)
- div (6)
- divmod (11)
- downto (11)
- drop (11)
-
drop
_ while (33) - each (189)
-
each
_ byte (33) -
each
_ char (33) -
each
_ child (34) -
each
_ codepoint (33) -
each
_ cons (11) -
each
_ entry (11) -
each
_ grapheme _ cluster (7) -
each
_ index (11) -
each
_ key (22) -
each
_ line (66) -
each
_ object (22) -
each
_ pair (33) -
each
_ slice (11) -
each
_ value (22) -
each
_ with _ index (11) -
each
_ with _ object (11) - eager (5)
- empty? (16)
- end (17)
- entries (22)
-
enum
_ for (44) - eql? (24)
- erf (11)
- erfc (11)
-
exclude
_ end? (6) - executable? (22)
-
executable
_ real? (22) - exist? (11)
- exists? (9)
- exit (22)
- exit! (22)
- exited? (11)
- exitstatus (11)
- exp (11)
- fatal (11)
- fdatasync (11)
- fdiv (28)
- feed (11)
-
fetch
_ values (18) - file? (22)
- filter (36)
- filter! (18)
-
filter
_ map (10) - find (11)
-
find
_ all (22) -
find
_ index (22) - finite? (11)
- first (12)
-
flat
_ map (33) - flatten (22)
- flatten! (11)
- flock (11)
- floor (27)
- fnmatch (11)
- fnmatch? (11)
- force (11)
- foreach (66)
- fork (22)
- format (11)
- frexp (11)
- ftype (11)
- gamma (11)
-
garbage
_ collect (22) - gid (11)
- glob (22)
- grep (33)
-
grep
_ v (31) -
group
_ by (11) - grpowned? (22)
- gsub (77)
- gsub! (44)
-
handle
_ interrupt (11) - hash (41)
- hypot (11)
- index (29)
- infinite? (11)
- ino (11)
- inspect (69)
- isatty (11)
- iterator? (11)
-
keep
_ if (33) - key (11)
- label (11)
- last (12)
-
last
_ match (22) -
last
_ status (7) -
latest
_ gc _ info (22) - lazy (22)
- ldexp (11)
- length (11)
- lgamma (11)
- lineno (11)
- lines (42)
-
load
_ from _ binary _ extra _ data (9) - log (22)
- log10 (11)
- log2 (11)
- loop (11)
- lstat (22)
- lutime (7)
- magnitude (19)
- map (33)
- map! (11)
-
marshal
_ dump (11) - match (55)
- match? (24)
-
max
_ by (22) - members (4)
-
min
_ by (22) -
minmax
_ by (11) - mkdir (11)
- mode (11)
- modulo (17)
- mtime (11)
-
named
_ captures (11) - names (11)
- nan? (11)
- negative? (26)
- new (138)
- next (11)
-
next
_ float (10) -
next
_ values (11) - nlink (11)
- none? (13)
- numerator (55)
- offset (22)
- one? (13)
- open (66)
- owned? (22)
- pack (19)
-
parse
_ file (8) - partition (11)
- path (92)
- peek (11)
-
peek
_ values (11) - permutation (22)
- phase (33)
- pid (11)
- pipe? (22)
- positive? (17)
-
post
_ match (11) -
pre
_ match (11) -
prepend
_ features (11) -
prev
_ float (10) -
primitive
_ convert (44) - printf (44)
- private (46)
-
private
_ call? (8) -
private
_ class _ method (15) -
private
_ constant (11) -
private
_ instance _ methods (11) -
private
_ method _ defined? (11) -
private
_ methods (11) - produce (5)
- quo (22)
- rand (88)
- rationalize (99)
-
raw
_ data (11) - rdev (11)
-
rdev
_ major (11) -
rdev
_ minor (11) - read (33)
- readable? (22)
-
readable
_ real? (22) - readlines (33)
- readlink (11)
- realdirpath (11)
- realpath (11)
- regexp (11)
- reject (55)
- reject! (33)
- remainder (3)
-
remove
_ const (11) - reopen (22)
-
repeated
_ combination (22) -
repeated
_ permutation (22) - replicate (11)
-
report
_ on _ exception= (16) - require (11)
-
require
_ relative (11) -
resolve
_ feature _ path (1) -
respond
_ to _ missing? (11) - result (11)
-
reverse
_ each (22) - rewind (17)
- rindex (22)
- rmdir (11)
- rotate (11)
- rotate! (11)
- round (34)
-
ruby2
_ keywords (10) - saturday? (11)
- scan (22)
-
search
_ convpath (11) - select (66)
- select! (33)
- setgid? (22)
- setuid? (22)
- signaled? (11)
- sin (11)
- sinh (11)
- size (67)
- size? (22)
-
slice
_ after (42) -
slice
_ before (55) -
slice
_ when (21) - socket? (22)
-
sort
_ by (11) -
sort
_ by! (11) -
source
_ location (39) - split (11)
- sprintf (11)
- sqrt (11)
- start (11)
- stat (54)
- state (22)
- status (22)
- step (96)
- sticky? (22)
- stime (11)
- stopped? (11)
- stopsig (11)
- strftime (11)
- string (11)
- sub (55)
- sub! (33)
- subsec (11)
- success? (11)
- symlink? (22)
- sync= (11)
- sysopen (11)
- take (11)
-
take
_ while (44) - tan (11)
- tanh (11)
- terminate (11)
- termsig (11)
- then (6)
- times (11)
-
to
_ a (11) -
to
_ binary (9) -
to
_ enum (44) -
to
_ f (83) -
to
_ h (4) -
to
_ i (33) -
to
_ path (24) -
to
_ proc (5) -
to
_ r (77) -
to
_ regexp (11) -
to
_ s (57) -
total
_ time (11) - tr (11)
- tr! (11)
-
tr
_ s (11) -
tr
_ s! (11) -
transform
_ keys (7) -
transform
_ keys! (7) -
transform
_ values (8) -
transform
_ values! (8) - truncate (66)
- tty? (11)
- uid (11)
- union (11)
- uniq (16)
- unlink (11)
- unpack (11)
- unpack1 (8)
- update (44)
- upto (11)
- utime (22)
-
values
_ at (55) - wait2 (11)
- waitall (11)
- waitpid2 (11)
- warn (9)
- with (2)
-
with
_ index (32) -
with
_ object (22) -
world
_ readable? (33) -
world
_ writable? (33) - writable? (22)
-
writable
_ real? (22) - write (22)
- yield (11)
-
yield
_ self (7) - zero? (33)
- zip (22)
検索結果
先頭5件
-
Array
# repeated _ permutation(n) { |p| . . . } -> self (20200.0) -
サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
...実行します。
得られる順列の順序は保証されません。ブロックなしで呼び出されると, 順列
を生成する Enumerator オブジェクトを返します。
@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェ......eated_permutation(1).to_a #=> [[1], [2]]
a.repeated_permutation(2).to_a #=> [[1,1],[1,2],[2,1],[2,2]]
a.repeated_permutation(3).to_a #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
a.repeated_permutation(0).to_a #=> [[]] # one permutati......ロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2]
result = []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
//}
@see Array#repeated_combination, Array#permutation... -
File
:: PATH _ SEPARATOR -> ";" | ":" (20200.0) -
PATH 環境変数の要素のセパレータです。UNIX では ":" MS-DOS な どでは ";" です。
...PATH 環境変数の要素のセパレータです。UNIX では ":" MS-DOS な
どでは ";" です。... -
RubyVM
. resolve _ feature _ path (20200.0) -
require を呼んだときに読み込まれるファイルを特定します。 このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。
...require を呼んだときに読み込まれるファイルを特定します。
このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。
//emlist[][ruby]{
p RubyVM.resolve_feature_path('set')
# => [:rb, "/build-all-ruby/2.6.0/lib/ruby/2.6.0/set.rb"]
//}... -
MatchData
# values _ at(*index) -> [String] (20131.0) -
正規表現中の n 番目の括弧にマッチした部分文字列の配列を返します。
...]{
m = /(foo)(bar)(baz)/.match("foobarbaz")
# same as m.to_a.values_at(...)
p m.values_at(0, 1, 2, 3, 4) # => ["foobarbaz", "foo", "bar", "baz", nil]
p m.values_at(-1, -2, -3, -4, -5) # => ["baz", "bar", "foo", nil, nil]
m = /(?<a>\d+) *(?<op>[+\-*\/]) *(?<b>\d+)/.match("1 + 2")
m.to_a......# => ["1 + 2", "1", "+", "2"]
m.values_at(:a, :b, :op) # => ["1", "2", "+"]
//}
@see Array#values_at, Array#[]... -
MatchData
# post _ match -> String (20100.0) -
マッチした部分より後ろの文字列を返します($'と同じ)。
...マッチした部分より後ろの文字列を返します($'と同じ)。
//emlist[例][ruby]{
/(bar)(BAZ)?/ =~ "foobarbaz"
p $~.post_match # => "baz"
//}
@see MatchData#pre_match... -
MatchData
# pre _ match -> String (20100.0) -
マッチした部分より前の文字列を返します($`と同じ)。
...マッチした部分より前の文字列を返します($`と同じ)。
//emlist[例][ruby]{
/(bar)(BAZ)?/ =~ "foobarbaz"
p $~.pre_match # => "foo"
//}
@see MatchData#post_match... -
MatchData (20000.0)
-
正規表現のマッチに関する情報を扱うためのクラス。
...正規表現のマッチに関する情報を扱うためのクラス。
このクラスのインスタンスは、
* Regexp.last_match
* Regexp#match, String#match
* $~
などにより得られます。... -
NoMatchingPatternError (20000.0)
-
パターンマッチでどの条件にも一致せず、else節もない場合に発生します。
パターンマッチでどの条件にも一致せず、else節もない場合に発生します。 -
Enumerator
:: Lazy # collect _ concat {|item| . . . } -> Enumerator :: Lazy (17200.0) -
ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。
...ロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。
//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}
ブロックの返した値 x......き
* x が each および force メソッドを持つ (例:Enumerator::Lazy) とき
それ以外のときは、x は分解されず、そのままの値として使われます。
//emlist[][ruby]{
[{a:1}, {b:2}].lazy.flat_map {|i| i}.force
#=> [{:a=>1}, {:b=>2}]
//}
@raise ArgumentError ブ......ロックを指定しなかった場合に発生します。
@see Enumerable#flat_map... -
Enumerator
:: Lazy # flat _ map {|item| . . . } -> Enumerator :: Lazy (17200.0) -
ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。
...ロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。
//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}
ブロックの返した値 x......き
* x が each および force メソッドを持つ (例:Enumerator::Lazy) とき
それ以外のときは、x は分解されず、そのままの値として使われます。
//emlist[][ruby]{
[{a:1}, {b:2}].lazy.flat_map {|i| i}.force
#=> [{:a=>1}, {:b=>2}]
//}
@raise ArgumentError ブ......ロックを指定しなかった場合に発生します。
@see Enumerable#flat_map... -
Float
# next _ float -> Float (17200.0) -
浮動小数点数で表現可能な self の次の値を返します。
...ます。
Float::MAX.next_float、Float::INFINITY.next_float は
Float::INFINITY を返します。Float::NAN.next_float は
Float::NAN を返します。
//emlist[例][ruby]{
p 0.01.next_float # => 0.010000000000000002
p 1.0.next_float # => 1.0000000000000002
p 100.0.next_float # => 100.000000......00000001
p 0.01.next_float - 0.01 # => 1.734723475976807e-18
p 1.0.next_float - 1.0 # => 2.220446049250313e-16
p 100.0.next_float - 100.0 # => 1.4210854715202004e-14
f = 0.01; 20.times { printf "%-20a %s\n", f, f.to_s; f = f.next_float }
# => 0x1.47ae147ae147bp-7 0.01
# 0x1.47ae147ae147cp......47ae147ae1489p-7 0.010000000000000024
# 0x1.47ae147ae148ap-7 0.010000000000000026
# 0x1.47ae147ae148bp-7 0.010000000000000028
# 0x1.47ae147ae148cp-7 0.01000000000000003
# 0x1.47ae147ae148dp-7 0.010000000000000031
# 0x1.47ae147ae148ep-7 0.010000000000000033
//}
@see Float#prev_float... -
Float
# prev _ float -> Float (17200.0) -
浮動小数点数で表現可能な self の前の値を返します。
...。
(-Float::MAX).prev_float と (-Float::INFINITY).prev_float
は -Float::INFINITY を返します。Float::NAN.prev_float は
Float::NAN を返します。
//emlist[例][ruby]{
p 0.01.prev_float # => 0.009999999999999998
p 1.0.prev_float # => 0.9999999999999999
p 100.0.prev_float # => 99.9999......9999999999
p 0.01 - 0.01.prev_float # => 1.734723475976807e-18
p 1.0 - 1.0.prev_float # => 1.1102230246251565e-16
p 100.0 - 100.0.prev_float # => 1.4210854715202004e-14
f = 0.01; 20.times { printf "%-20a %s\n", f, f.to_s; f = f.prev_float }
# => 0x1.47ae147ae147bp-7 0.01
# 0x1.47ae147ae14......47ae147ae146dp-7 0.009999999999999976
# 0x1.47ae147ae146cp-7 0.009999999999999974
# 0x1.47ae147ae146bp-7 0.009999999999999972
# 0x1.47ae147ae146ap-7 0.00999999999999997
# 0x1.47ae147ae1469p-7 0.009999999999999969
# 0x1.47ae147ae1468p-7 0.009999999999999967
//}
@see Float#next_float...