ライブラリ
- ビルトイン (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件
-
Time
. at(time) -> Time (26183.0) -
time で指定した時刻の Time オブジェクトを返します。
...ime.at(0) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-28......00 +0900
Time.at(946684800.2).usec # => 200000
Time.at(1582721899, in: "+09:00") # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: 9*60*60) # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: "UTC") # => 2020-02-26 12:58:19 UTC
Time.at(1582721899,... -
Time
. at(time , in:) -> Time (26183.0) -
time で指定した時刻の Time オブジェクトを返します。
...ime.at(0) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-28......00 +0900
Time.at(946684800.2).usec # => 200000
Time.at(1582721899, in: "+09:00") # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: 9*60*60) # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: "UTC") # => 2020-02-26 12:58:19 UTC
Time.at(1582721899,... -
Time
. at(time) -> Time (26171.0) -
time で指定した時刻の Time オブジェクトを返します。
...ime.at(0) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-28......4061600) # => 1960-12-31 15:00:00 +0900
Time.at(946684800.2).usec # => 200000
Time.at(1582721899, in: "+09:00") # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: 9*60*60) # => 2020-02-26 21:58:19 +0900
//}... -
Time
. at(time , in:) -> Time (26171.0) -
time で指定した時刻の Time オブジェクトを返します。
...ime.at(0) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-28......4061600) # => 1960-12-31 15:00:00 +0900
Time.at(946684800.2).usec # => 200000
Time.at(1582721899, in: "+09:00") # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: 9*60*60) # => 2020-02-26 21:58:19 +0900
//}... -
Time
. at(time) -> Time (26156.0) -
time で指定した時刻の Time オブジェクトを返します。
...ime.at(0) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-28......4061600) # => 1960-12-31 15:00:00 +0900
Time.at(946684800.2).usec # => 200000
//}... -
Time
. at(seconds , xseconds , unit) -> Time (26143.0) -
unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。
...などの時刻を表す Time オブジェクトを返します。
@param seconds 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param xseconds unit に対応するミリ秒かマイクロ秒かナノ秒を指定します......ンを指定します。
//emlist[][ruby]{
Time.at(946684800, 123.456789, :millisecond).nsec # => 123456789
Time.at(946684800, 123456.789, :usec).nsec # => 123456789
Time.at(946684800, 123456.789, :microsecond).nsec # => 123456789
Time.at(946684800, 123456789, :nsec).nsec # => 12... -
Time
. at(seconds , xseconds , unit , in:) -> Time (26143.0) -
unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。
...などの時刻を表す Time オブジェクトを返します。
@param seconds 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param xseconds unit に対応するミリ秒かマイクロ秒かナノ秒を指定します......ンを指定します。
//emlist[][ruby]{
Time.at(946684800, 123.456789, :millisecond).nsec # => 123456789
Time.at(946684800, 123456.789, :usec).nsec # => 123456789
Time.at(946684800, 123456.789, :microsecond).nsec # => 123456789
Time.at(946684800, 123456789, :nsec).nsec # => 12... -
Time
. at(seconds , xseconds , unit) -> Time (26141.0) -
unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。
...などの時刻を表す Time オブジェクトを返します。
@param seconds 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param xseconds unit に対応するミリ秒かマイクロ秒かナノ秒を指定します......ンを指定します。
//emlist[][ruby]{
Time.at(946684800, 123.456789, :millisecond).nsec # => 123456789
Time.at(946684800, 123456.789, :usec).nsec # => 123456789
Time.at(946684800, 123456.789, :microsecond).nsec # => 123456789
Time.at(946684800, 123456789, :nsec).nsec # => 12... -
Time
. at(seconds , xseconds , unit , in:) -> Time (26141.0) -
unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。
...などの時刻を表す Time オブジェクトを返します。
@param seconds 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param xseconds unit に対応するミリ秒かマイクロ秒かナノ秒を指定します......ンを指定します。
//emlist[][ruby]{
Time.at(946684800, 123.456789, :millisecond).nsec # => 123456789
Time.at(946684800, 123456.789, :usec).nsec # => 123456789
Time.at(946684800, 123456.789, :microsecond).nsec # => 123456789
Time.at(946684800, 123456789, :nsec).nsec # => 12... -
Time
. at(seconds , xseconds , unit) -> Time (26136.0) -
unit に応じて seconds + xseconds ミリ秒などの時刻を表す Time オブジェクトを返します。
...、 Float、 Rational、または他のNumericで指定します。
@param xseconds unit に対応するミリ秒かマイクロ秒かナノ秒を指定します。
@param unit :millisecond, :usec, :microsecond, :nsec, :nanosecond のいずれかを指定します。
//emlist[][ruby]{
Time.at(94668......4800, 123.456789, :millisecond).nsec # => 123456789
Time.at(946684800, 123456.789, :usec).nsec # => 123456789
Time.at(946684800, 123456.789, :microsecond).nsec # => 123456789
Time.at(946684800, 123456789, :nsec).nsec # => 123456789
//}... -
Time
. at(time , usec) -> Time (26128.0) -
time + (usec/1000000) の時刻を表す Time オブジェクトを返します。 浮動小数点の精度では不十分な場合に使用します。
...なります。
@param time 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param usec マイクロ秒をInteger、 Float、 Rational、または他のNumericで指定します。
@param in "+HH:MM" や "-HH:MM" のよう......な形式の文字列か
"UTC" かミリタリータイムゾーンの文字列または
数値でタイムゾーンを指定します。
//emlist[][ruby]{
Time.at(946684800, 123456.789).nsec # => 123456789
//}... -
Time
. at(time , usec , in:) -> Time (26128.0) -
time + (usec/1000000) の時刻を表す Time オブジェクトを返します。 浮動小数点の精度では不十分な場合に使用します。
...なります。
@param time 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param usec マイクロ秒をInteger、 Float、 Rational、または他のNumericで指定します。
@param in "+HH:MM" や "-HH:MM" のよう......な形式の文字列か
"UTC" かミリタリータイムゾーンの文字列または
数値でタイムゾーンを指定します。
//emlist[][ruby]{
Time.at(946684800, 123456.789).nsec # => 123456789
//}... -
Time
. at(time , usec) -> Time (26126.0) -
time + (usec/1000000) の時刻を表す Time オブジェクトを返します。 浮動小数点の精度では不十分な場合に使用します。
...なります。
@param time 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param usec マイクロ秒をInteger、 Float、 Rational、または他のNumericで指定します。
@param in "+HH:MM" や "-HH:MM" のよう......な形式の文字列か
数値でタイムゾーンを指定します。
//emlist[][ruby]{
Time.at(946684800, 123456.789).nsec # => 123456789
//}... -
Time
. at(time , usec , in:) -> Time (26126.0) -
time + (usec/1000000) の時刻を表す Time オブジェクトを返します。 浮動小数点の精度では不十分な場合に使用します。
...なります。
@param time 起算時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param usec マイクロ秒をInteger、 Float、 Rational、または他のNumericで指定します。
@param in "+HH:MM" や "-HH:MM" のよう......な形式の文字列か
数値でタイムゾーンを指定します。
//emlist[][ruby]{
Time.at(946684800, 123456.789).nsec # => 123456789
//}... -
Time
. at(time , usec) -> Time (26121.0) -
time + (usec/1000000) の時刻を表す Time オブジェクトを返します。 浮動小数点の精度では不十分な場合に使用します。
...時からの経過秒数を表わす値をInteger、 Float、 Rational、または他のNumericで指定します。
@param usec マイクロ秒をInteger、 Float、 Rational、または他のNumericで指定します。
//emlist[][ruby]{
Time.at(946684800, 123456.789).nsec # => 123456789
//}... -
Array
# at(nth) -> object | nil (23101.0) -
nth 番目の要素を返します。nth 番目の要素が存在しない時には nil を返します。
nth 番目の要素を返します。nth 番目の要素が存在しない時には nil を返します。
@param nth インデックスを整数で指定します。
先頭の要素が 0 番目になります。nth の値が負の時には末尾から
のインデックスと見倣します。末尾の要素が -1 番目になります。
整数以外のオブジェクトを指定した場合は to_int メソッドによる
暗黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定... -
Array
# repeated _ combination(n) -> Enumerator (20300.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
...得られる組み合わせの順序は保証されません。ブロックなしで呼び出されると、
組み合わせを生成する Enumerator オブジェクトを返します。
@param n 生成される配列のサイズを整数で指定します。
整数以外のオブジェ......epeated_combination(1).to_a #=> [[1], [2], [3]]
a.repeated_combination(2).to_a #=> [[1,1],[1,2],[1,3],[2,2],[2,3],[3,3]]
a.repeated_combination(3).to_a #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
# [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
a.repeated_combinatio......3,3]]
a.repeated_combination(0).to_a #=> [[]] # one combination of length 0
//}
ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.repeated_combination(3) {|e|... -
Array
# repeated _ permutation(n) -> Enumerator (20300.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... -
Array
# repeated _ combination(n) { |c| . . . } -> self (20200.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
...得られる組み合わせの順序は保証されません。ブロックなしで呼び出されると、
組み合わせを生成する Enumerator オブジェクトを返します。
@param n 生成される配列のサイズを整数で指定します。
整数以外のオブジェ......epeated_combination(1).to_a #=> [[1], [2], [3]]
a.repeated_combination(2).to_a #=> [[1,1],[1,2],[1,3],[2,2],[2,3],[3,3]]
a.repeated_combination(3).to_a #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
# [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
a.repeated_combinatio......3,3]]
a.repeated_combination(0).to_a #=> [[]] # one combination of length 0
//}
ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.repeated_combination(3) {|e|... -
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...