733件ヒット
[1-100件を表示]
(0.094秒)
別のキーワード
ライブラリ
クラス
- Array (35)
-
CSV
:: Table (12) - Data (6)
- Enumerator (24)
- File (12)
- Hash (196)
-
JSON
:: State (48) - MatchData (16)
- Matrix (108)
-
OpenSSL
:: ASN1 :: ASN1Data (24) - OptionParser (36)
- Prime (12)
-
REXML
:: Attribute (12) -
REXML
:: Attributes (36) -
REXML
:: CData (24) -
REXML
:: DocType (12) -
REXML
:: Element (72) - String (12)
- Struct (36)
キーワード
- [] (12)
- []= (12)
-
add
_ attribute (24) -
add
_ attributes (12) -
attributes
_ of (12) - bytebegin (2)
- byteend (2)
- coerce (12)
- configure (12)
-
delete
_ if (12) - each (36)
-
each
_ attribute (12) -
each
_ element _ with _ attribute (12) -
each
_ key (12) -
each
_ pair (24) -
each
_ value (12) - eigen (12)
- eigensystem (12)
-
fetch
_ values (22) - filter (7)
- filter! (7)
-
find
_ index (36) - flock (12)
-
get
_ text (12) - indent (12)
- indent= (12)
- index (36)
-
keep
_ if (12) - merge (12)
-
next
_ values (12) - on (36)
- pack (21)
-
peek
_ values (12) -
prime
_ division (12) - reject (12)
- reject! (12)
- select (12)
- select! (12)
- text (12)
-
to
_ h (6) -
to
_ s (12) -
to
_ string (12) -
transform
_ values (9) -
transform
_ values! (9) - unpack (12)
- value= (12)
-
values
_ at (60)
検索結果
先頭5件
-
OpenSSL
:: ASN1 :: ASN1Data # value -> object (21140.0) -
ASN.1 値に対応するRubyのオブジェクトを返します。
...ASN.1 値に対応するRubyのオブジェクトを返します。
@see OpenSSL::ASN1::ASN1Data#value=... -
MatchData
# values _ at(*index) -> [String] (18244.0) -
正規表現中の n 番目の括弧にマッチした部分文字列の配列を返します。
...mlist[例][ruby]{
m = /(foo)(bar)(baz)/.match("foobarbaz")
# same as 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#[]... -
REXML
:: CData # value -> String (18126.0) -
テキスト文字列を返します。
...テキスト文字列を返します。
@see REXML::Text#value, REXML::Text#to_s
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root><![CDATA[foobar baz]]></root>
EOS
doc.root[0].class # => REXML::CData
doc.root[0].value # => "foobar baz"
//}... -
Array
# values _ at(*selectors) -> Array (12262.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]
//}... -
CSV
:: Table # values _ at(indices _ or _ headers) -> Array (12238.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......]
//}
//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"]]
//}
@... -
Hash
# values _ at(*keys) -> [object] (12226.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... -
Struct
# values _ at(*members) -> [object] (12220.0) -
引数で指定されたメンバの値の配列を返します。
...or member が整数で存在しないメンバを指定した場合に発生します。
//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 の下位クラ... -
OpenSSL
:: ASN1 :: ASN1Data # value=(value) (9247.0) -
ASN.1 値に対応するRubyのオブジェクトを変更します。
...ASN.1 値に対応するRubyのオブジェクトを変更します。
@param value 設定するオブジェクト
@see OpenSSL::ASN1::ASN1Data#value... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (9219.0) -
各属性に対しブロックを呼び出します。
...個々の属性は REXML::Attribute オブジェクトで渡されます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.......get_elements("/root/a").first
a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}...