482件ヒット
[1-100件を表示]
(0.023秒)
ライブラリ
- ビルトイン (154)
-
cgi
/ core (24) - csv (28)
- dbm (12)
- matrix (12)
- openssl (36)
- optparse (144)
- rake (12)
-
rexml
/ document (12) -
rinda
/ tuplespace (12) -
win32
/ registry (12) - win32ole (12)
クラス
- Array (56)
-
CGI
:: Cookie (12) -
CSV
:: Row (12) -
CSV
:: Table (12) - DBM (12)
- Enumerator (24)
- Hash (54)
- MatchData (12)
- Matrix (12)
-
OpenSSL
:: X509 :: ExtensionFactory (36) - OptionParser (144)
-
REXML
:: Element (12) -
Rake
:: TaskArguments (12) -
Rinda
:: TupleEntry (12) - String (12)
-
WIN32OLE
_ VARIANT (12) -
Win32
:: Registry (12)
モジュール
キーワード
- [] (12)
- []= (12)
-
add
_ attributes (12) - coerce (12)
- compact (9)
- compact! (9)
-
create
_ ext _ from _ array (12) -
create
_ extension (24) - names (12)
-
next
_ values (12) - on (144)
- pack (21)
-
peek
_ values (12) - rassoc (12)
- select (12)
- shift (12)
-
to
_ a (12) -
to
_ ary (12) -
to
_ csv (4) -
to
_ h (19) - unpack (12)
-
values
_ at (60)
検索結果
先頭5件
-
CGI
:: Cookie # value -> Array (18203.0) -
クッキーの値を返します。
クッキーの値を返します。 -
Rinda
:: TupleEntry # value -> Array | Hash (18203.0) -
管理対象のタプルを返します。
管理対象のタプルを返します。 -
Array
# values _ at(*selectors) -> Array (15202.0) -
引数で指定されたインデックスに対応する要素を配列で返します。インデッ クスに対応する値がなければ nil が要素になります。
...ry.values_at( 0, 2, 4 ) #=> ["a", "c", "e"]
p ary.values_at( 3, 4, 5, 6, 35 ) #=> ["d", "e", nil, nil, nil]
p ary.values_at( 0, -1, -2 ) #=> ["a", "e", "d"]
p ary.values_at( -4, -5, -6, -35 ) #=> ["b", "a", nil, nil]
p ary.values_at( 1..2 ) #=> ["b", "c"]
p ary.values_......at( 3..10 ) #=> ["d", "e", nil, nil, nil, nil, nil, nil]
p ary.values_at( 6..7 ) #=> [nil, nil]
p ary.values_at( 0, 3..5 ) #=> ["a", "d", "e", nil]
//}... -
Array
# pack(template) -> String (9025.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...template 自身のバイナリとしてパックするためのテンプレートを文字列で指定します。
以下にあげるものは、Array#pack、String#unpack
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表す数字
を続けること......endian int32_t
l!<: little endian signed long
//}
=== 各テンプレート文字の説明
説明中、Array#pack と String#unpack で違いのあるものは `/' で区切って
「Array#pack の説明 / String#unpack の説明」としています。
: a
ASCII文字列(ヌル文字を詰......"
[0x7fffffff].pack("U") # => "\xFD\xBF\xBF\xBF\xBF\xBF"
[0x80000000].pack("U") # => RangeError: pack(U): value out of range
[0,256,65536].pack("U3").b # => "\x00\xC4\x80\xF0\x90\x80\x80"
"\x00\xC4\x80\xF0\x90\x80\x80".unpack("U3") # => [0,......ます。
指定した場合は返値も指定した文字列オブジェクトになります。
以下にあげるものは、Array#pack、String#unpack、String#unpack1
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表す数字
を... -
Array
# pack(template , buffer: String . new) -> String (9025.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...ます。
指定した場合は返値も指定した文字列オブジェクトになります。
以下にあげるものは、Array#pack、String#unpack、String#unpack1
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表す数字
を......endian int32_t
l!<: little endian signed long
//}
=== 各テンプレート文字の説明
説明中、Array#pack と String#unpack で違いのあるものは `/' で区切って
「Array#pack の説明 / String#unpack の説明」としています。
: a
ASCII文字列(ヌル文字を詰......"
[0x7fffffff].pack("U") # => "\xFD\xBF\xBF\xBF\xBF\xBF"
[0x80000000].pack("U") # => RangeError: pack(U): value out of range
[0,256,65536].pack("U3").b # => "\x00\xC4\x80\xF0\x90\x80\x80"
"\x00\xC4\x80\xF0\x90\x80\x80".unpack("U3") # => [0,... -
Array
# to _ csv(**options) -> String (9019.0) -
CSV.generate_line(self, options) と同様です。
...CSV.generate_line(self, options) と同様です。
Array オブジェクトを 1 行の CSV 文字列に変換するためのショートカットです。
@param options CSV.generate_line と同様のオプションを指定します。
//emlist[][ruby]{
require 'csv'
p [1, 'Matz', :Ruby, Dat....../emlist[][ruby]{
require 'csv'
puts [1, nil].to_csv # => 1,
puts [1, nil].to_csv(write_nil_value: "N/A") # => 1,N/A
puts [2, ""].to_csv # => 2,""
puts [2, ""].to_csv(write_empty_value: "BLANK") # => 2,BLANK
//}
@see CSV.generate_line... -
Array
# to _ h -> Hash (9017.0) -
self を [key, value] のペアの配列として解析した結果を Hash にして 返します。
...self を [key, value] のペアの配列として解析した結果を Hash にして
返します。
//emlist[例][ruby]{
bar], [1, 2.to_h # => {:foo => :bar, 1 => 2}
//}......self を [key, value] のペアの配列として解析した結果を Hash にして
返します。
//emlist[例][ruby]{
bar], [1, 2.to_h # => {:foo => :bar, 1 => 2}
//}
ブロックを指定すると配列の各要素でブロックを呼び出し、
その結果をペアとして使います... -
Array
# to _ h { block } -> Hash (9017.0) -
self を [key, value] のペアの配列として解析した結果を Hash にして 返します。
...self を [key, value] のペアの配列として解析した結果を Hash にして
返します。
//emlist[例][ruby]{
bar], [1, 2.to_h # => {:foo => :bar, 1 => 2}
//}
ブロックを指定すると配列の各要素でブロックを呼び出し、
その結果をペアとして使います... -
CSV
:: Table # values _ at(indices _ or _ headers) -> Array (6202.0) -
デフォルトのミックスモードでは、インデックスのリストを与えると行単位の 参照を行い、行の配列を返します。他の方法は列単位の参照と見なします。行 単位の参照では、返り値は行ごとの配列を要素に持つ配列です。
...r1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])
table.values_at(1) # => [#<CSV::Row "header1":"row2_1" "header2":"row2_2">]
//}
//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.by_col!
table.values_at(1) # => [["row1_2"], ["row2_2"]]
//}
@see CSV::Table#by_col!, CSV::Table#by_row!... -
Enumerator
# next _ values -> Array (6202.0) -
「次」のオブジェクトを配列で返します。
...values の違いを][ruby]{
o = Object.new
def o.each
yield
yield 1
yield 1, 2
yield nil
yield [1, 2]
end
e = o.to_enum
p e.next_values
p e.next_values
p e.next_values
p e.next_values
p e.next_values
e = o.to_enum
p e.next
p e.next
p e.next
p e.next
p e.next
## yield args next_value......[1] 1
# yield 1, 2 [1, 2] [1, 2]
# yield nil [nil] nil
# yield [1, 2] [[1, 2]] [1, 2]
//}
@raise StopIteration 列挙状態が既に最後へ到達しているとき
@see Enumerator#next, Enumerator#peek, Enumerator#peek_values...