ライブラリ
- ビルトイン (3139)
- abbrev (12)
- benchmark (12)
- bigdecimal (12)
-
cgi
/ core (48) - csv (276)
- date (4)
- dbm (24)
- delegate (12)
- erb (12)
- expect (24)
- json (60)
- matrix (96)
-
minitest
/ unit (4) - mkmf (36)
-
net
/ imap (60) - observer (24)
- openssl (72)
- optparse (180)
- ostruct (10)
- pathname (12)
- pp (24)
- pstore (12)
- rake (240)
-
rake
/ rdoctask (24) -
rake
/ testtask (24) -
rdoc
/ context (12) -
rdoc
/ text (12) -
rexml
/ document (48) -
rexml
/ parsers / pullparser (24) -
rexml
/ parsers / ultralightparser (12) -
rinda
/ rinda (36) -
rinda
/ tuplespace (48) -
rubygems
/ command (24) -
rubygems
/ command _ manager (12) -
rubygems
/ commands / update _ command (12) -
rubygems
/ commands / which _ command (24) -
rubygems
/ dependency _ installer (72) -
rubygems
/ dependency _ list (24) -
rubygems
/ format (12) -
rubygems
/ indexer (24) -
rubygems
/ old _ format (12) -
rubygems
/ platform (12) -
rubygems
/ requirement (12) -
rubygems
/ security (24) -
rubygems
/ source _ index (24) -
rubygems
/ source _ info _ cache (12) -
rubygems
/ spec _ fetcher (48) -
rubygems
/ specification (96) -
rubygems
/ user _ interaction (24) - scanf (36)
- set (45)
- shell (18)
-
shell
/ command-processor (6) -
shell
/ filter (6) -
shell
/ process-controller (18) - shellwords (12)
- socket (108)
- thwait (6)
- tsort (24)
-
webrick
/ httprequest (24) -
webrick
/ https (12) -
webrick
/ httpserver (12) -
webrick
/ httputils (24) -
win32
/ registry (12) - win32ole (48)
クラス
-
ARGF
. class (60) - Array (1743)
- BasicSocket (12)
-
Benchmark
:: Tms (12) - BigDecimal (12)
- CSV (96)
-
CSV
:: Row (36) -
CSV
:: Table (132) - DBM (24)
- Data (3)
- Date (2)
- DateTime (2)
- ERB (12)
-
Encoding
:: Converter (24) - Enumerator (24)
-
Gem
:: Command (24) -
Gem
:: CommandManager (12) -
Gem
:: Commands :: UpdateCommand (12) -
Gem
:: Commands :: WhichCommand (24) -
Gem
:: DependencyInstaller (72) -
Gem
:: DependencyList (24) -
Gem
:: Format (12) -
Gem
:: Indexer (24) -
Gem
:: OldFormat (12) -
Gem
:: Platform (12) -
Gem
:: Requirement (12) -
Gem
:: Security :: Policy (12) -
Gem
:: Security :: Signer (12) -
Gem
:: SourceIndex (24) -
Gem
:: SourceInfoCache (12) -
Gem
:: SpecFetcher (48) -
Gem
:: Specification (96) -
Gem
:: StreamUI (12) - Hash (76)
- IO (60)
- IPSocket (36)
-
JSON
:: State (48) - MatchData (62)
- Matrix (24)
- Method (44)
-
MiniTest
:: Unit (2) - Module (192)
-
Net
:: IMAP (12) -
Net
:: IMAP :: BodyTypeBasic (12) -
Net
:: IMAP :: BodyTypeMessage (12) -
Net
:: IMAP :: BodyTypeMultipart (12) -
Net
:: IMAP :: BodyTypeText (12) - NilClass (12)
- Object (136)
-
OpenSSL
:: BN (12) -
OpenSSL
:: X509 :: ExtensionFactory (36) - OpenStruct (10)
- OptionParser (144)
-
OptionParser
:: ParseError (36) - PStore (12)
- Pathname (12)
-
RDoc
:: Context (12) -
REXML
:: Element (12) -
REXML
:: Parent (36) -
REXML
:: Parsers :: PullEvent (24) -
REXML
:: Parsers :: UltraLightParser (12) -
Rake
:: Application (12) -
Rake
:: FileList (84) -
Rake
:: NameSpace (12) -
Rake
:: RDocTask (24) -
Rake
:: Task (48) -
Rake
:: TaskArguments (12) -
Rake
:: TestTask (24) - Random (36)
- Range (38)
- Rational (24)
- Regexp (12)
-
Rinda
:: TupleEntry (12) -
Rinda
:: TupleSpace (36) -
Rinda
:: TupleSpaceProxy (36) -
RubyVM
:: AbstractSyntaxTree :: Node (7) -
RubyVM
:: InstructionSequence (12) - Set (60)
- Shell (18)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6) -
Shell
:: ProcessController (18) - Socket (36)
-
Socket
:: Option (12) - String (57)
- Struct (28)
- ThreadsWait (6)
- Time (14)
- UDPSocket (12)
- UnboundMethod (24)
- Vector (72)
-
WEBrick
:: HTTPRequest (36) -
WEBrick
:: HTTPServer :: MountTable (12) -
WEBrick
:: HTTPUtils :: FormData (24) - WIN32OLE (12)
-
WIN32OLE
_ VARIANT (36) -
Win32
:: Registry (12)
モジュール
-
CGI
:: QueryExtension (24) -
CGI
:: QueryExtension :: Value (24) - Enumerable (556)
- FileUtils (12)
-
Gem
:: UserInteraction (12) -
JSON
:: Generator :: GeneratorMethods :: Array (12) - Kernel (60)
-
MiniTest
:: Assertions (2) - Observable (24)
-
OpenSSL
:: SSL :: SocketForwarder (24) -
RDoc
:: Text (12) -
Rake
:: TaskManager (48) - TSort (24)
キーワード
- & (24)
- * (36)
- + (12)
- - (12)
- << (12)
- <=> (12)
- == (36)
- === (8)
- =~ (16)
- DelegateClass (12)
- [] (192)
- []= (72)
-
_ invoke (12) - abbrev (12)
- accept (12)
-
accept
_ nonblock (12) - actions (12)
-
active
_ jobs (6) -
add
_ attributes (12) -
add
_ bindir (12) -
add
_ extra _ args (12) -
add
_ observer (12) -
add
_ to (12) - addr (36)
- all? (45)
- any? (39)
-
arg
_ names (12) - args (12)
-
array
_ nl (12) -
array
_ nl= (12) -
assert
_ send (1) - at (12)
- bsearch (48)
-
bsearch
_ index (20) - call (24)
-
capture
_ io (1) -
cert
_ chain (24) - children (7)
-
choose
_ from _ list (24) - cipher (12)
- class (12)
- coerce (48)
- collect (48)
- collect! (24)
- collect2 (24)
-
collect
_ concat (24) - combination (24)
- compact (25)
- compact! (21)
-
compact
_ specs (12) - concat (33)
- converters (12)
- convpath (12)
- count (72)
-
create
_ ext _ from _ array (12) -
create
_ extension (24) -
current
_ scope (12) - cycle (12)
-
deconstruct
_ keys (17) - delete (24)
-
delete
_ at (12) -
delete
_ if (24) -
delete
_ observers (12) - dependencies (12)
-
dependent
_ gems (12) -
development
_ dependencies (12) - difference (7)
- dig (40)
-
drop
_ while (48) - each (24)
- each2 (24)
-
each
_ index (12) - empty? (24)
- entries (7)
-
enum
_ for (24) - eql? (24)
- expect (24)
- extension (48)
- fcntl (12)
- fetch (48)
-
fetch
_ values (2) -
file
_ entries (24) - fill (24)
- filter (14)
- filter! (14)
-
find
_ command _ possibilities (12) -
find
_ gems _ with _ sources (12) -
find
_ index (36) -
find
_ matching (12) -
find
_ paths (12) -
find
_ spec _ by _ name _ and _ version (12) -
find
_ type (24) - first (48)
-
flat
_ map (24) - flatten (36)
- flatten! (24)
-
force
_ encoding (12) - freeze (12)
-
gather
_ dependencies (12) -
gem
_ file _ list (12) -
gem
_ paths (12) -
gems
_ to _ install (12) -
get
_ all _ gem _ names (12) - gets (12)
- grep (24)
- hash (12)
-
header
_ converters (12) - headers (24)
- import (12)
-
in
_ namespace (12) - index (36)
- insert (12)
- inspect (12)
- install (12)
-
install
_ rb (12) -
installed
_ gems (12) - intersect? (4)
- intersection (18)
- ioctl (12)
-
is
_ a? (12) - jobs (6)
- join (12)
-
keep
_ if (24) -
kind
_ of? (12) - last (24)
-
latest
_ specs (12) -
legacy
_ repos (12) - length (36)
- libs (12)
- list (24)
- map (48)
- map! (24)
- map2 (12)
-
marshal
_ dump (12) - max (42)
-
max
_ by (48) - min (42)
-
min
_ by (48) - minmax (24)
- mkdir (18)
-
module
_ function (36) - names (12)
-
next
_ values (12) - none? (14)
- on (144)
- one? (42)
-
option
_ list (12) - outdated (12)
- pack (21)
- params (12)
- parse (24)
-
pathmap
_ explode (12) -
peek
_ values (12) - peeraddr (36)
- permutation (24)
- pop (12)
- prerequisites (12)
-
pretty
_ print (12) -
pretty
_ print _ cycle (12) -
primitive
_ errinfo (12) - private (48)
-
private
_ class _ method (24) - product (24)
- protected (48)
- public (12)
-
public
_ class _ method (24) - rand (36)
- read (36)
-
read
_ all (24) - readline (12)
- readlines (36)
- recover (12)
- recvfrom (12)
-
recvfrom
_ nonblock (12) - reject (48)
- reject! (24)
-
remove
_ by _ name (12) -
repeated
_ combination (24) -
repeated
_ permutation (24) - replace (12)
- report (1)
- requirements (12)
-
resolve
_ args (12) -
response
_ handlers (12) -
reverse
_ each (24) - rindex (36)
- roots (12)
- rotate (12)
- rotate! (12)
-
ruby
_ opts (12) -
run
_ test _ suites (1) -
runtime
_ dependencies (12) - sample (24)
- scan (12)
- scanf (36)
-
search
_ with _ source (12) - select (36)
- select! (24)
- sendmsg (12)
-
set
_ backtrace (12) -
set
_ eoutvar (12) - shelljoin (12)
- shift (48)
- size (36)
- slice (12)
- slice! (24)
- sort (24)
- sort! (24)
-
sort
_ by (24) -
sort
_ by! (24) - sources (12)
-
spec
_ predecessors (12) - split (12)
-
split
_ all (12) -
strongly
_ connected _ components (12) - sum (42)
- sysaccept (12)
-
system
_ path (6) -
system
_ path= (6) - table (12)
- take (48)
-
take
_ while (48) - tap (12)
- tasks (24)
- threads (6)
-
to
_ a (223) -
to
_ ary (60) -
to
_ csv (12) -
to
_ enum (24) -
to
_ h (31) -
to
_ hash (12) -
to
_ json (12) -
to
_ s (12) -
top
_ level _ tasks (12) - transpose (12)
- tsort (12)
- union (7)
- uniq (24)
- uniq! (12)
- unpack (24)
- unpack1 (9)
- unshift (12)
- value (12)
-
values
_ at (60) - vartype (12)
-
verify
_ gem (12) -
waiting
_ jobs (6) -
which
_ to _ update (12) - zip (24)
- | (12)
検索結果
先頭5件
-
Array
# first -> object | nil (15209.0) -
配列の先頭の要素を返します。要素がなければ nil を返します。
...配列の先頭の要素を返します。要素がなければ nil を返します。
//emlist[例][ruby]{
p [0, 1, 2].first #=> 0
p [].first #=> nil
//}
@see Array#last... -
Array
# first(n) -> Array (15209.0) -
先頭の n 要素を配列で返します。n は 0 以上でなければなりません。
...を指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
@raise ArgumentError n が負値の場合......発生します。
//emlist[例][ruby]{
ary = [0, 1, 2]
p ary.first(0)
p ary.first(1)
p ary.first(2)
p ary.first(3)
p ary.first(4)
# => []
# [0]
# [0, 1]
# [0, 1, 2]
# [0, 1, 2]
//}
@see Array#last... -
Array
# last -> object | nil (15209.0) -
配列の末尾の要素を返します。配列が空のときは nil を返します。
...配列の末尾の要素を返します。配列が空のときは nil を返します。
//emlist[例][ruby]{
p [0, 1, 2].last #=> 2
p [].last #=> nil
//}
@see Array#first... -
Array
# last(n) -> Array (15209.0) -
末尾の n 要素を配列で返します。n は 0 以上でなければなりません。
...を指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
@raise ArgumentError n が負値の場合......発生します。
//emlist[例][ruby]{
ary = [0, 1, 2]
p ary.last(0)
p ary.last(1)
p ary.last(2)
p ary.last(3)
p ary.last(4)
# => []
# [2]
# [1, 2]
# [0, 1, 2]
# [0, 1, 2]
//}
@see Array#first... -
Array
# sort -> Array (15209.0) -
配列の内容をソートします。要素同士の比較は <=> 演算子を使って行います。sort はソートされた配列を生成して返します。 sort! は self を破壊的にソートし、self を返します。
...配列の内容をソートします。要素同士の比較は <=> 演算子を使って行います。sort はソートされた配列を生成して返します。
sort! は self を破壊的にソートし、self を返します。
ブロックとともに呼び出された時には、要素......t[例][ruby]{
ary1 = [ "d", "a", "e", "c", "b" ]
p ary1.sort #=> ["a", "b", "c", "d", "e"]
ary2 = ["9", "7", "10", "11", "8"]
p ary2.sort #=> ["10", "11", "7", "8", "9"] (文字列としてソートするとこうなる)
p ary2.sort{|a, b| a.t......o_i <=> b.to_i } #=> ["7", "8", "9", "10", "11"] (ブロックを使って数字としてソート)
# sort_by を使っても良い
p ary2.sort_by{|x| x.to_i } #=> ["7", "8", "9", "10", "11"]
//}
@see Enumerable#sort_by
, Array#sort_by!... -
Array
# sort {|a , b| . . . } -> Array (15209.0) -
配列の内容をソートします。要素同士の比較は <=> 演算子を使って行います。sort はソートされた配列を生成して返します。 sort! は self を破壊的にソートし、self を返します。
...配列の内容をソートします。要素同士の比較は <=> 演算子を使って行います。sort はソートされた配列を生成して返します。
sort! は self を破壊的にソートし、self を返します。
ブロックとともに呼び出された時には、要素......t[例][ruby]{
ary1 = [ "d", "a", "e", "c", "b" ]
p ary1.sort #=> ["a", "b", "c", "d", "e"]
ary2 = ["9", "7", "10", "11", "8"]
p ary2.sort #=> ["10", "11", "7", "8", "9"] (文字列としてソートするとこうなる)
p ary2.sort{|a, b| a.t......o_i <=> b.to_i } #=> ["7", "8", "9", "10", "11"] (ブロックを使って数字としてソート)
# sort_by を使っても良い
p ary2.sort_by{|x| x.to_i } #=> ["7", "8", "9", "10", "11"]
//}
@see Enumerable#sort_by
, Array#sort_by!... -
Array
# rotate(cnt = 1) -> Array (15208.0) -
cnt で指定したインデックスの要素が先頭になる配列を新しく作成します。 cnt より前の要素は末尾に移動します。cnt に負の数を指定した場合、逆の操 作を行います。
...cnt で指定したインデックスの要素が先頭になる配列を新しく作成します。
cnt より前の要素は末尾に移動します。cnt に負の数を指定した場合、逆の操
作を行います。
@param cnt 先頭にする要素のインデックスを指定します......は to_int メソッドによる
暗黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = [ "a", "b", "c", "d" ]
a.rotate......# => ["b", "c", "d", "a"]
a # => ["a", "b", "c", "d"]
a.rotate(2) # => ["c", "d", "a", "b"]
a.rotate(-1) # => ["d", "a", "b", "c"]
a.rotate(-3) # => ["b", "c", "d", "a"]
//}
@see Array#rotate!... -
Array
# transpose -> Array (15208.0) -
自身を行列と見立てて、行列の転置(行と列の入れ換え)を行いま す。転置した配列を生成して返します。空の配列に対しては空の配列を生 成して返します。
...
TypeError が発生します。各要素のサイズが不揃いな配列に対して
は、例外 IndexError が発生します。
//emlist[例][ruby]{
p [[1,2],
[3,4],
[5,6]].transpose
# => [[1, 3, 5], [2, 4, 6]]
p [].transpose
# => []
p [1,2,3].transpose
# => -:1:in `transpose': cannot......convert Fixnum into Array (TypeError)
# from -:1
p [[1,2],
[3,4,5],
[6,7]].transpose
# => -:3:in `transpose': element size differ (3 should be 2) (IndexError)
//}... -
Array
# filter {|item| . . . } -> [object] (15207.0) -
各要素に対してブロックを評価した値が真であった要素を全て含む配列を 返します。真になる要素がひとつもなかった場合は空の配列を返します。
...の配列を返します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
[1,2,3,4,5].select # => #<Enumerator: [1, 2, 3, 4, 5]:select>
[1,2,3,4,5].select { |num| num.even? } # => [2, 4]
//}
@see Enumerable#select
@see Array#select!...