1124件ヒット
[1-100件を表示]
(0.106秒)
クラス
- Array (168)
- CSV (24)
-
CSV
:: FieldInfo (12) -
CSV
:: Row (12) -
CSV
:: Table (60) - Enumerator (67)
-
Enumerator
:: Lazy (12) -
File
:: Stat (12) - Hash (36)
- MatchData (110)
- Matrix (36)
- NilClass (12)
- Object (36)
- OptionParser (12)
-
REXML
:: Attributes (12) -
REXML
:: Elements (12) -
Rake
:: FileList (36) - Range (14)
- Regexp (24)
-
RubyVM
:: InstructionSequence (12) - Set (12)
- String (176)
- Struct (30)
- Time (12)
- Vector (12)
モジュール
- Enumerable (163)
キーワード
- + (7)
- << (24)
- == (12)
- [] (48)
- atime (12)
- bytes (24)
- captures (12)
- chain (7)
- chars (24)
- chunk (12)
-
chunk
_ while (12) - codepoints (24)
-
col
_ sep (12) - combination (24)
- deconstruct (8)
- delete (12)
-
delete
_ if (24) - each (72)
-
each
_ codepoint (24) -
each
_ grapheme _ cluster (16) -
each
_ line (24) - entries (19)
- force (12)
-
grapheme
_ clusters (16) -
header
_ converters (12) - keys (12)
- length (12)
- line (12)
- lines (24)
- match (24)
-
max
_ by (48) - permutation (24)
-
repeated
_ combination (24) -
repeated
_ permutation (24) - sample (48)
- size (24)
-
slice
_ after (24) -
slice
_ before (24) -
slice
_ when (12) - tap (12)
-
to
_ ary (36) - values (24)
-
values
_ at (12)
検索結果
先頭5件
-
RubyVM
:: InstructionSequence # to _ a -> Array (21220.0) -
self の情報を 14 要素の配列にして返します。
...命令シーケンスを構成する命令とオペランドの配列の配列。
//emlist[例][ruby]{
require 'pp'
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:arg_... -
Time
# to _ a -> Array (18262.0) -
時刻を10要素の配列で返します。
...。
* sec: 秒 (整数 0-60) (60はうるう秒)
* min: 分 (整数 0-59)
* hour: 時 (整数 0-23)
* mday: 日 (整数)
* mon: 月 (整数 1-12)
* year: 年 (整数 2000年=2000)
* wday: 曜日 (整数 0-6)
* yday: 年内通算日 (整数 1-366)
* isdst: 夏時間で......あるかどうか (true/false)
* zone: タイムゾーン (文字列)
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5)
p t # => 2000-01-02 03:04:05 +0900
p t.to_a # => [5, 4, 3, 2, 1, 2000, 0, 2, false, "JST"]
//}
要素の順序は C 言語の tm 構造体に合わせています。た... -
Array
# to _ a -> Array (18232.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... -
OptionParser
# to _ a -> [String] (18232.0) -
サマリの各行を要素とした配列を返します。
...を返します。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.to_a # => ["Usage: test [options]", " -i, --init\n", " -u, --update\n", " -h, --help\n"]
//}... -
Matrix
# to _ a -> Array (18226.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]]
//}... -
Object
# to _ a -> Array (18226.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] (18220.0) -
すべての子要素の配列を返します。
...無視されます。
@param xpath XPath文字列
//emlist[][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... -
CSV
:: Table # to _ a -> [Array] (18214.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"... -
Hash
# to _ a -> [Array] (18214.0) -
キーと値からなる 2 要素の配列を並べた配列を生成して返します。
...キーと値からなる 2 要素の配列を並べた配列を生成して返します。
//emlist[例][ruby]{
h1 = { "a" => 100, 2 => ["some"], :c => "c" }
p h1.to_a #=> c, "c"
//}
@see Hash#keys,Hash#values...