1541件ヒット
[201-300件を表示]
(0.042秒)
種類
- インスタンスメソッド (1010)
- 特異メソッド (444)
- モジュール関数 (60)
- クラス (27)
クラス
- Array (54)
- Data (6)
- Enumerator (24)
-
Enumerator
:: Lazy (12) - File (12)
- Hash (620)
- LocalJumpError (24)
- MatchData (16)
- Module (12)
- Object (12)
-
ObjectSpace
:: WeakMap (12) - Range (12)
- String (12)
- Struct (98)
- Thread (102)
-
Thread
:: Queue (30) - TracePoint (12)
- UncaughtThrowError (11)
モジュール
- Enumerable (19)
- GC (12)
- Kernel (48)
- Process (12)
オブジェクト
- ENV (342)
キーワード
- << (10)
- Data (3)
- Float (12)
- Hash (12)
- Integer (12)
- KeyError (12)
- Symbol (12)
- [] (48)
- []= (48)
- bytebegin (2)
- byteend (2)
- clear (12)
- compact (9)
- compact! (9)
-
const
_ set (12) - default= (12)
-
delete
_ if (48) - detach (12)
- each (72)
-
each
_ key (24) -
each
_ pair (72) -
each
_ value (48) - enq (10)
- exit (12)
-
exit
_ value (12) - fetch (36)
-
fetch
_ values (22) - filter (28)
- filter! (28)
- flock (12)
-
has
_ key? (12) -
has
_ value? (24) - include? (12)
-
instance
_ variable _ set (12) -
keep
_ if (48) - key? (12)
- kill (12)
- member? (12)
- new (48)
-
next
_ values (12) - pack (21)
-
peek
_ values (12) - push (10)
- rassoc (24)
- reason (12)
- reject (48)
- reject! (48)
-
report
_ on _ exception (9) -
report
_ on _ exception= (9) -
return
_ value (12) - select (48)
- select! (48)
- shift (12)
- store (24)
- stress= (12)
- terminate (12)
-
thread
_ variable _ get (12) -
thread
_ variable _ set (12) - throw (12)
-
to
_ h (86) -
transform
_ values (18) -
transform
_ values! (18) - unpack (12)
- value? (24)
- values (36)
-
values
_ at (60)
検索結果
先頭5件
-
ENV
. values -> [String] (6102.0) -
環境変数の全値の配列を返します。
環境変数の全値の配列を返します。 -
ENV
. values _ at(*key) -> [String] (6102.0) -
引数で指定されたキー(環境変数名)に対応する値の配列を返します。存在 しないキーに対しては nil が対応します。
...列を返します。存在
しないキーに対しては nil が対応します。
例:
ENV.update({'FOO' => 'foo', 'BAR' => 'bar'})
p ENV.values_at(*%w(FOO BAR BAZ)) # => ["foo", "bar", nil]
@param key 環境変数名を指定します。文字列で指定します。
文字... -
Enumerator
# next _ values -> Array (6102.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... -
Enumerator
# peek _ values -> Array (6102.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... -
Hash
# fetch _ values(key , . . . ) -> [object] (6102.0) -
引数で指定されたキーに関連づけられた値の配列を返します。
...=> "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_at, Hash#fetch... -
Hash
# fetch _ values(key , . . . ) { |key| . . . } -> [object] (6102.0) -
引数で指定されたキーに関連づけられた値の配列を返します。
...=> "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_at, Hash#fetch... -
Hash
# values -> [object] (6102.0) -
ハッシュの全値の配列を返します。
...ハッシュの全値の配列を返します。
//emlist[例][ruby]{
h1 = { "a" => 100, 2 => ["some"], :c => "c" }
p h1.values #=> [100, ["some"], "c"]
//}
@see Hash#keys,Hash#to_a... -
Hash
# values _ at(*keys) -> [object] (6102.0) -
引数で指定されたキーに対応する値の配列を返します。
...引数が指定されなかった場合は、空の配列を返します。
//emlist[例][ruby]{
h = {1=>"a", 2=>"b", 3=>"c"}
p h.values_at(1,3,4) #=> ["a", "c", nil]
# [h[1], h[3] ,h[4]] と同じ
//}
@see Hash#[] , Hash.new, Hash#default, Hash#default_proc, Array#values_at... -
MatchData
# values _ at(*index) -> [String] (6102.0) -
正規表現中の n 番目の括弧にマッチした部分文字列の配列を返します。
...m.to_a.values_at(...)
p m.values_at(0, 1, 2, 3, 4) # => ["foobarbaz", "foo", "bar", "baz", nil]
p m.values_at(-1, -2, -3, -4, -5) # => ["baz", "bar", "foo", nil, nil]
m = /(?<a>\d+) *(?<op>[+\-*\/]) *(?<b>\d+)/.match("1 + 2")
m.to_a # => ["1 + 2", "1", "+", "2"]
m.values_at(:......a, :b, :op) # => ["1", "2", "+"]
//}
@see Array#values_at, Array#[]... -
Struct
# values _ at(*members) -> [object] (6102.0) -
引数で指定されたメンバの値の配列を返します。
...ンバを指定した場合に発生します。
//emlist[例][ruby]{
Foo = Struct.new(:foo, :bar, :baz)
obj = Foo.new('FOO', 'BAR', 'BAZ')
p obj.values_at(0, 1, 2) # => ["FOO", "BAR", "BAZ"]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼...
