396件ヒット
[1-100件を表示]
(0.130秒)
ライブラリ
クラス
- Array (12)
-
CSV
:: Row (24) -
CSV
:: Table (12) - DBM (12)
- Enumerator (24)
- GDBM (12)
- Hash (108)
- IPSocket (12)
- SDBM (12)
- TCPServer (12)
- UDPSocket (12)
-
Win32
:: Registry (96) -
YAML
:: DBM (48)
キーワード
- [] (12)
- addr (12)
-
descriptor
_ length (12) -
fetch
_ values (20) - fields (12)
- info (12)
- keys (12)
-
max
_ key _ length (12) -
max
_ value _ length (12) -
max
_ value _ name _ length (12) -
next
_ values (12) -
num
_ keys (12) -
num
_ values (12) -
peek
_ values (12) -
recvfrom
_ nonblock (12) - select (24)
- sysaccept (12)
-
to
_ a (12) -
transform
_ keys (20) -
transform
_ keys! (20) -
values
_ at (96) - wtime (12)
検索結果
先頭5件
-
YAML
:: DBM # values -> object (21102.0) -
データベース中に存在する値全てを含む配列を返します。
データベース中に存在する値全てを含む配列を返します。 -
Array
# values _ at(*selectors) -> Array (9250.0) -
引数で指定されたインデックスに対応する要素を配列で返します。インデッ クスに対応する値がなければ nil が要素になります。
...ist[例][ruby]{
ary = %w( a b c d e )
p ary.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]
//}... -
YAML
:: DBM # values _ at(*keys) -> [object] (9202.0) -
keys に対応する値を配列に格納して返します。
...keys に対応する値を配列に格納して返します。
対応するキーが見つからなかった要素には nil が格納されます。
@param keys キーを文字列で指定します。複数指定することができます。... -
Enumerator
# peek _ values -> Array (6272.0) -
Enumerator#next_values のように「次」のオブジェクトを 配列で返しますが、列挙状態を変化させません。
...Enumerator#next_values のように「次」のオブジェクトを
配列で返しますが、列挙状態を変化させません。
Enumerator#next, Enumerator#next_values のように
現在までの列挙状態に応じて「次」のオブジェクトを返しますが、
next と異なり......r#next_values と同様
yield
と
yield nil
を区別するために使えます。
//emlist[例][ruby]{
o = Object.new
def o.each
yield
yield 1
yield 1, 2
end
e = o.to_enum
p e.peek_values #=> []
e.next
p e.peek_values #=> [1]
p e.peek_values #=> [1]
e.next
p e.peek_values #=......> [1, 2]
e.next
p e.peek_values # raises StopIteration
//}
@raise StopIteration 列挙状態が既に最後へ到達しているとき
@see Enumerator#next, Enumerator#next_values, Enumerator#peek_values... -
Enumerator
# next _ values -> Array (6250.0) -
「次」のオブジェクトを配列で返します。
...ほぼ同様の挙動をします。終端まで到達した場合は
StopIteration 例外を発生させます。
このメソッドは、
yield
と
yield nil
を区別するために使えます。
next メソッドによる外部列挙の状態は他のイテレータメソッドによる......ext と next_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_values next
# yield [] nil
# yield 1 [1] 1
# yield 1, 2 [1, 2] [1, 2]
# yield nil [nil] nil
# yield [1, 2] [[1, 2]] [1, 2]
//}
@raise StopIteration 列挙状態が既に最後へ到達し... -
Hash
# fetch _ values(key , . . . ) -> [object] (6227.0) -
引数で指定されたキーに関連づけられた値の配列を返します。
...ックが与えられていない時は
KeyError が発生します。
self にデフォルト値が設定されていても無視されます(挙動に変化がありません)。
@param key 探索するキーを任意個指定します。
@raise KeyError ブロックが与えられてない......by]{
h = { "cat" => "feline", "dog" => "canine", "cow" => "bovine" }
h.fetch_values("cow", "cat") # => ["bovine", "feline"]
h.fetch_values("cow", "bird") # raises KeyError
h.fetch_values("cow", "bird") { |k| k.upcase } # => ["bovine", "BIRD"]
//}
@see Hash#values... -
Hash
# fetch _ values(key , . . . ) { |key| . . . } -> [object] (6227.0) -
引数で指定されたキーに関連づけられた値の配列を返します。
...ックが与えられていない時は
KeyError が発生します。
self にデフォルト値が設定されていても無視されます(挙動に変化がありません)。
@param key 探索するキーを任意個指定します。
@raise KeyError ブロックが与えられてない......by]{
h = { "cat" => "feline", "dog" => "canine", "cow" => "bovine" }
h.fetch_values("cow", "cat") # => ["bovine", "feline"]
h.fetch_values("cow", "bird") # raises KeyError
h.fetch_values("cow", "bird") { |k| k.upcase } # => ["bovine", "BIRD"]
//}
@see Hash#values... -
GDBM
# values _ at(*keys) -> [String] (6220.0) -
keys に対応する値を配列に格納して返します。
...keys に対応する値を配列に格納して返します。
@param keys キー。複数指定可能です。
require 'gdbm'
db1 = GDBM.open('aaa.gdbm', 0666, GDBM::NEWDB)
db1['a'] = 'aaa'
db1['b'] = 'bbb'
db1['c'] = 'ccc'
p db1.values_at('a', 'b') #=> ["aaa", "bbb"]
p db1.v......alues_at('x', 'y') #=> [nil, nil]... -
CSV
:: Table # values _ at(indices _ or _ headers) -> Array (6214.0) -
デフォルトのミックスモードでは、インデックスのリストを与えると行単位の 参照を行い、行の配列を返します。他の方法は列単位の参照と見なします。行 単位の参照では、返り値は行ごとの配列を要素に持つ配列です。
...配列です。
探索方法を変更したい場合は CSV::Table#by_col!,
CSV::Table#by_row! を使用してください。
アクセスモードを混在させることはできません。
//emlist[例 ロウモード][ruby]{
require "csv"
row1 = CSV::Row.new(["header1", "header2"], ["row1_1.......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!...