ライブラリ
- ビルトイン (1107)
- benchmark (12)
-
cgi
/ core (24) - csv (132)
- dbm (12)
- gdbm (12)
- matrix (96)
-
net
/ smtp (84) - openssl (24)
- optparse (12)
- ostruct (24)
- rake (36)
- readline (36)
-
rexml
/ document (60) -
rubygems
/ platform (12) - sdbm (12)
- set (12)
- shell (24)
-
shell
/ command-processor (24) -
shell
/ filter (30) - socket (24)
-
webrick
/ httputils (12) -
yaml
/ dbm (12)
クラス
-
ARGF
. class (96) - Array (168)
-
Benchmark
:: Tms (12) - CSV (24)
-
CSV
:: FieldInfo (12) -
CSV
:: Row (24) -
CSV
:: Table (72) - DBM (12)
- Enumerator (67)
-
Enumerator
:: Chain (7) -
Enumerator
:: Lazy (12) -
File
:: Stat (12) - GDBM (12)
-
Gem
:: Platform (12) - Hash (36)
- MatchData (110)
- Matrix (36)
-
Matrix
:: EigenvalueDecomposition (24) -
Matrix
:: LUPDecomposition (24) -
Net
:: SMTP (84) - NilClass (12)
- Object (36)
-
OpenSSL
:: X509 :: Extension (12) -
OpenSSL
:: X509 :: Name (12) - OpenStruct (24)
- OptionParser (12)
-
REXML
:: Attributes (12) -
REXML
:: Element (12) -
REXML
:: Elements (12) -
REXML
:: Parent (24) -
Rake
:: FileList (36) - Range (14)
- Regexp (24)
-
RubyVM
:: InstructionSequence (12) - SDBM (12)
- Set (12)
- Shell (24)
-
Shell
:: CommandProcessor (24) -
Shell
:: Filter (30) - Socket (12)
- String (176)
- Struct (30)
- Time (108)
- Vector (12)
-
WEBrick
:: HTTPUtils :: FormData (12) -
YAML
:: DBM (12)
モジュール
-
CGI
:: QueryExtension :: Value (24) - Enumerable (163)
- Kernel (12)
- Readline (12)
-
Socket
:: Constants (12)
オブジェクト
- ENV (12)
-
Readline
:: HISTORY (12)
キーワード
- + (7)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - << (24)
- == (12)
- Array (12)
-
IPPROTO
_ AH (24) -
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - Readline (12)
- [] (48)
- atime (12)
- bytes (24)
- captures (12)
- cat (18)
- chain (7)
- chars (24)
- children (12)
- chunk (12)
-
chunk
_ while (12) - codepoints (24)
-
col
_ sep (12) - combination (24)
- deconstruct (8)
- delete (12)
-
delete
_ at (12) -
delete
_ if (24) - each (72)
-
each
_ byte (24) -
each
_ codepoint (24) -
each
_ grapheme _ cluster (16) -
each
_ line (24) -
each
_ pair (24) - echo (18)
- entries (19)
- force (12)
-
get
_ elements (12) - glob (18)
- gm (24)
-
grapheme
_ clusters (16) -
header
_ converters (12) -
irb
/ completion (12) - keys (12)
- length (12)
- line (12)
- lines (24)
- local (24)
- match (24)
-
max
_ by (48) - mktime (24)
- new (31)
- permutation (24)
- rake (12)
-
rb
_ Array (12) - rcptto (12)
-
rcptto
_ list (12) -
rdoc
/ markup / to _ ansi (12) - readline (12)
- readlines (36)
- ready (12)
-
repeated
_ combination (24) -
repeated
_ permutation (24) -
ruby 1
. 6 feature (12) - rubygems (12)
- sample (48)
-
send
_ mail (12) - sendmail (12)
- size (24)
-
slice
_ after (24) -
slice
_ before (24) -
slice
_ when (12) -
svalue
_ to _ avalue (12) - tap (12)
- tee (18)
-
to
_ ary (84) - utc (24)
- values (24)
-
values
_ at (12) - メソッド呼び出し(super・ブロック付き・yield) (12)
検索結果
先頭5件
-
Array
# to _ a -> Array (18125.0) -
self を返します。ただし、Array のサブクラスのインスタンスに対して呼ばれた時は、 自身を Array に変換したものを返します。
...に変換したものを返します。
//emlist[例][ruby]{
class SubArray < Array; end
ary1 = Array([1, 2, 3, 4])
ary2 = SubArray([1, 2, 3, 4])
ary1.to_a # => [1, 2, 3, 4]
ary1.to_a.class # => Array
ary2.to_a # => [1, 2, 3, 4]
ary2.to_a.class # => Array
//}
@see Array#to_ary... -
Object
# to _ a -> Array (18119.0) -
オブジェクトを配列に変換した結果を返します。 デフォルトでは定義されていません。
...のメソッドは実際には Object クラスには定義されていません。
必要に応じてサブクラスで定義すべきものです。
//emlist[][ruby]{
p( {'a'=>1}.to_a ) # [["a", 1]]
p ['array'].to_a # ["array"]
p nil.to_a # []
//}
@see Object#to_ary,Kernel.#Array... -
REXML
:: Elements # to _ a(xpath = nil) -> [REXML :: Element] (18113.0) -
すべての子要素の配列を返します。
...][ruby]{
require 'rexml/document'
require 'rexml/xpath'
doc = REXML::Document.new '<a>sean<b/>elliott<c/></a>'
doc.root.elements.to_a # => [<b/>, <c/>]
doc.root.elements.to_a("child::node()") # => [<b/>, <c/>]
REXML::XPath.match(doc.root, "child::node()") # => ["sean", <b/>, "elliott", <c/>]
//}... -
CSV
:: Table # to _ a -> [Array] (18107.0) -
配列の配列を返します。
...。
//emlist[例][ruby]{
require "csv"
row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])
table.to_a # => [["header1", "header2"], ["row1_1", "row1_2"], ["row2_1", "row2_2"]]
//}... -
DBM
# to _ a -> [Array] (18107.0) -
キーと値のペアを配列に変換して返します。
...キーと値のペアを配列に変換して返します。
require 'dbm'
db1 = DBM.open('aaa.db', 0666, DBM::NEWDB)
db1[:a] = 'aaa'
db1[:b] = 'bbbbbb'
p db1.to_a #=> [["b", "bbbbbb"], ["a", "aaa"]]... -
Hash
# to _ a -> [Array] (18107.0) -
キーと値からなる 2 要素の配列を並べた配列を生成して返します。
...キーと値からなる 2 要素の配列を並べた配列を生成して返します。
//emlist[例][ruby]{
h1 = { "a" => 100, 2 => ["some"], :c => "c" }
p h1.to_a #=> c, "c"
//}
@see Hash#keys,Hash#values... -
MatchData
# to _ a -> [String] (18107.0) -
$&, $1, $2,... を格納した配列を返します。
...$&, $1, $2,... を格納した配列を返します。
//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.to_a # => ["foobar", "foo", "bar", nil]
//}
@see MatchData#captures... -
Matrix
# to _ a -> Array (18107.0) -
自分自身をArrayに変換したものを返します。
...します。
行ベクトルを配列(Array)としたものの配列(つまり配列の配列)として返します。
//emlist[例][ruby]{
require 'matrix'
a1 = [ 1, 2, 3]
a2 = [10, 15, 20]
a3 = [-1, -2, 1.5]
m = Matrix[a1, a2, a3]
p m.to_a # => [[1, 2, 3], [10, 15, 20], [-1, -2, 1.5]]
//}... -
NilClass
# to _ a -> Array (18107.0) -
空配列 [] を返します。
...空配列 [] を返します。
//emlist[例][ruby]{
nil.to_a #=> []
//}...