るりまサーチ

最速Rubyリファレンスマニュアル検索!
499件ヒット [1-100件を表示] (0.075秒)
トップページ > クエリ:-[x] > クエリ:to_a[x] > クエリ:new[x]

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

検索結果

<< 1 2 3 ... > >>

CSV::Row.new(headers, fields, header_row = false) -> CSV::Row (18243.0)

自身を初期化します。

...CSV::Row.new(["header1", "header2"], [], header_row: true)
table = CSV::Table.new([header])
table.to_a # => [["header1", "header2"]]
//}

//emlist[例 header_row = false のケース][ruby]{
require "csv"

row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["header...
...1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])
table.to_a # => [["header1", "header2"], ["row1_1", "row1_2"], ["row2_1", "row2_2"]]
//}

@see CSV::Row#header_row?, CSV::Row#field_row?...

OptionParser#to_a -> [String] (18231.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"]
//}...

CSV::Table#to_a -> [Array] (18225.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", "row...

CSV::Table.new(array_of_rows) -> CSV::Table (18225.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", "row...

Struct#to_a -> [object] (18225.0)

構造体のメンバの値を配列にいれて返します。

...ct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_a
# => ["Joe Smith", "123 Maple, Anytown NC", 12345]
//}

[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new...

絞り込み条件を変える

REXML::Elements#to_a(xpath = nil) -> [REXML::Element] (18219.0)

すべての子要素の配列を返します。

...ath文字列

//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, "child::node()") # => ["sean", <b/>,...

Enumerator::Chain.new(*enums) -> Enumerator::Chain (18213.0)

複数の Enumerable から、1つの新しい Enumerator を作って返します。

...複数の Enumerable から、1つの新しい Enumerator を作って返します。

//emlist[例][ruby]{
e = Enumerator::Chain.new(1..3, [4, 5])
e.to_a #=> [1, 2, 3, 4, 5]
e.size #=> 5
//}...

REXML::Attributes#to_a -> [Attribute] (18213.0)

属性の配列を返します。

...属性の配列を返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a x='1' y='2' z='3' />")
doc.root.attributes.to_a # => [x='1', y='2', z='3']
//}...

Shell::Filter#to_a -> [String] (18213.0)

実行結果を文字列の配列で返します。

...実行結果を文字列の配列で返します。

require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
puts sh.cat("/etc/passwd").to_a...

Range#to_a -> Array (15261.0)

self を配列に変換します。

...]{
p (5..0).to_a # => []
p (0..3).to_a # => [0, 1, 2, 3]
p ('a'..'c').to_a # => ["a", "b", "c"]
p (:a..:d).to_a # => [:a, :b, :c, :d]

require 'date'
p (Date.new(1965, 4, 14) .. Date.new(1965, 4, 14)).to_a # => [#<Date: 1965-04-14 ((2438865j,0s,0n),+0s,2299161j)>]

(1..).to_a # RangeEr...

絞り込み条件を変える

ruby 1.6 feature (8526.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...グ修正がメイン
になります。

((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。

== 1.6.8 (2002-12-24) -> stable-snapshot

: 2003-01-22: errno

EAGAIN と EWOULDBLOCK が同じ値の...
...した((<ruby-talk:40337>)), ((<ruby-core:00019>))

: 2002-09-11: Queue#((<Queue/pop>))

Queue#pop に競合状態の問題がありました ((<ruby-dev:17223>))

: 2002-09-11: SizedQueue.new

引数に 0 以下を受けつけるバグが修正されました。

: 2002-09-05: ((<リテラ...
...ました。
((<ruby-dev:13299>))

class X
include Enumerable

def each(&block)
block.call(1,2)
block.call(2,3)
block.call(3,4)
end
end

x = X.new
p x.to_a #=> [[1], [2], [3]]

# => ruby 1.6.3 (2001-03-19) [i586-linux]
[[1], [2...
<< 1 2 3 ... > >>