1422件ヒット
[201-300件を表示]
(0.123秒)
別のキーワード
ライブラリ
クラス
- Array (39)
- CGI (12)
-
CSV
:: Row (24) -
CSV
:: Table (36) - Enumerator (24)
- File (12)
- Hash (560)
-
JSON
:: Parser (12) -
JSON
:: State (36) - MatchData (16)
- Matrix (108)
- Module (12)
-
Net
:: HTTPResponse (12) - Object (12)
-
ObjectSpace
:: WeakMap (12) -
OpenSSL
:: ASN1 :: ASN1Data (24) - OptionParser (144)
- Prime (12)
-
REXML
:: Attributes (12) -
REXML
:: CData (24) -
REXML
:: Element (72) -
REXML
:: Text (24) -
Rake
:: TaskArguments (36) -
Resolv
:: DNS (12) - String (24)
- Struct (30)
- Thread (24)
- TracePoint (12)
- Vector (14)
-
WIN32OLE
_ VARIANT (12)
モジュール
- Enumerable (19)
キーワード
- [] (36)
- []= (98)
-
add
_ attribute (24) -
add
_ attributes (12) - bytebegin (2)
- byteend (2)
- coerce (12)
- compact (9)
- compact! (9)
- configure (12)
-
const
_ set (12) - default= (12)
-
delete
_ if (36) - each (24)
-
each
_ element _ with _ attribute (12) -
each
_ key (24) -
each
_ pair (24) -
each
_ value (24) - eigen (12)
- eigensystem (12)
- fetch (36)
-
fetch
_ values (22) - filter (14)
- filter! (14)
-
find
_ index (36) - flock (12)
-
get
_ text (12) -
has
_ key? (12) -
has
_ value? (12) - header (12)
- include? (12)
- indent= (12)
- index (36)
-
instance
_ variable _ set (12) -
keep
_ if (24) - key? (12)
- member? (12)
- merge (12)
-
new
_ scope (12) -
next
_ values (12) - on (144)
- pack (21)
- parse (12)
-
parse
_ csv (12) -
peek
_ values (12) -
prime
_ division (12) - rassoc (12)
- reject (24)
- reject! (24)
-
return
_ value (12) - select (24)
- select! (24)
- shift (12)
- store (12)
- text (12)
-
thread
_ variable _ set (12) - timeouts= (12)
-
to
_ csv (4) -
to
_ h (33) -
to
_ s (24) -
transform
_ values (18) -
transform
_ values! (18) - unpack (12)
- value= (12)
- value? (12)
- values (18)
-
values
_ at (60) -
with
_ defaults (12)
検索結果
先頭5件
-
TracePoint
# return _ value -> object (6120.0) -
メソッドやブロックの戻り値を返します。
...します。
@raise RuntimeError :return、:c_return、:b_return イベントのためのイベ
ントフックの外側で実行した場合に発生します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:return) do |tp|
p tp.return_value # => 1
end... -
CSV
:: Table # values _ at(indices _ or _ headers) -> Array (6119.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.values_at(1) # => [#<CSV::Row "header1":"row2_1" "header......カラムモード][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_co... -
Enumerator
# next _ values -> Array (6119.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 (6119.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... -
MatchData
# values _ at(*index) -> [String] (6119.0) -
正規表現中の n 番目の括弧にマッチした部分文字列の配列を返します。
...字列全体を表します。
@param index インデックスを整数またはシンボル(名前付きキャプチャの場合)で 0 個以上指定します。
//emlist[例][ruby]{
m = /(foo)(bar)(baz)/.match("foobarbaz")
# same as m.to_a.values_at(...)
p m.values_at(0, 1, 2, 3, 4) # => [......z", "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] (6119.0) -
引数で指定されたメンバの値の配列を返します。
...
@param members Integer か Range でメンバのインデックスを指定します。
@raise IndexError member が整数で存在しないメンバを指定した場合に発生します。
//emlist[例][ruby]{
Foo = Struct.new(:foo, :bar, :baz)
obj = Foo.new('FOO', 'BAR', 'BAZ')
p obj.values_... -
Array
# values _ at(*selectors) -> Array (6113.0) -
引数で指定されたインデックスに対応する要素を配列で返します。インデッ クスに対応する値がなければ nil が要素になります。
...ります。
@param selectors インデックスを整数もしくは整数の Range で指定します。
//emlist[例][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 )... -
Hash
# values -> [object] (6113.0) -
ハッシュの全値の配列を返します。
...ハッシュの全値の配列を返します。
//emlist[例][ruby]{
h1 = { "a" => 100, 2 => ["some"], :c => "c" }
p h1.values #=> [100, ["some"], "c"]
//}
@see Hash#keys,Hash#to_a... -
Struct
# values -> [object] (3113.0) -
構造体のメンバの値を配列にいれて返します。
...構造体のメンバの値を配列にいれて返します。
//emlist[例][ruby]{
Customer = Struct.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 は Struct の下位クラスを作成する点に
注意してください。
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Array
# pack(template) -> String (643.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...。
buffer が指定されていれば、バッファとして使って返値として返します。
もし template の最初にオフセット (@) が指定されていれば、
結果はオフセットの後ろから詰められます。
buffer の元の内容がオフセットより長けれ......保します。
//emlist[例][ruby]{
['!'].pack('@1a', buffer: 'abc') # => "a!"
['!'].pack('@5a', buffer: 'abc') # => "abc\u0000\u0000!"
//}
@param template 自身のバイナリとしてパックするためのテンプレートを文字列で指定します。
@param buffer 結果を詰め......][ruby]{
["abc"].pack("a") # => "a"
["abc"].pack("a*") # => "abc"
["abc"].pack("a4") # => "abc\x00"
"abc\0".unpack("a4") # => ["abc\x00"]
"abc ".unpack("a4") # => ["abc "]
//}
: A
ASCII文字列(スペースを詰める/後続するヌル文字やスペースを削除)
//emlist[][ruby]{...