738件ヒット
[1-100件を表示]
(0.090秒)
ライブラリ
- ビルトイン (306)
- csv (12)
- dbm (48)
- gdbm (36)
- matrix (72)
-
net
/ http (60) - openssl (12)
- ostruct (24)
-
rexml
/ document (48) -
rubygems
/ config _ file (12) - sdbm (36)
-
win32
/ registry (24) - win32ole (36)
-
yaml
/ dbm (12)
クラス
- Array (21)
-
CSV
:: Table (12) - DBM (48)
- Enumerator (24)
- GDBM (36)
-
Gem
:: ConfigFile (12) - Hash (158)
- Matrix (72)
-
OpenSSL
:: Config (12) - OpenStruct (24)
-
REXML
:: AttlistDecl (12) -
REXML
:: Attributes (24) -
REXML
:: Element (12) - SDBM (36)
- String (12)
- Struct (48)
- Thread (24)
- WIN32OLE (12)
-
WIN32OLE
_ TYPE (12) -
WIN32OLE
_ VARIABLE (12) -
Win32
:: Registry (24) -
YAML
:: DBM (12)
モジュール
- Enumerable (19)
-
Net
:: HTTPHeader (60)
キーワード
- [] (12)
-
canonical
_ each (12) -
each
_ attribute (12) -
each
_ capitalized (12) -
each
_ element _ with _ attribute (12) -
each
_ header (12) -
each
_ key (24) -
each
_ pair (108) -
each
_ value (96) - filter! (14)
-
find
_ index (36) - index (36)
-
keep
_ if (24) -
next
_ values (12) - pack (21)
-
peek
_ values (12) - select! (24)
-
to
_ h (19) - unpack (12)
- update (12)
- variables (12)
検索結果
先頭5件
-
Hash
# each {|key , value| . . . } -> self (18261.0) -
ハッシュのキーと値を引数としてブロックを評価します。
...
each_pair は each のエイリアスです。
//emlist[例][ruby]{
{:a=>1, :b=>2}.each {|a| p a}
#=> [:a, 1]
# [:b, 2]
{:a=>1, :b=>2}.each {|k, v| p [k, v]}
#=> [:a, 1]
# [:b, 2]
p({:a=>1, :b=>2}.each_pair) # => #<Enumerator: {:a=>1, :b=>2}:each_pair>
//}
@see Hash#each_key,Hash#each_val... -
OpenSSL
:: Config # each {|section , key , value| . . . } -> self (18221.0) -
オブジェクトに含まれる全ての設定情報を順にブロックに渡し 呼び出します。
...文字列、の3つです。
require 'openssl'
conf = OpenSSL::Config.load(OpenSSL::Config::DEFAULT_CONFIG_FILE)
conf.each{|section, key, value| p [section, key, value]}
# => ["req_distinguished_name", "countryName", "Country Name (2 letter code)"]
# => ["req_distinguished_name", "country... -
REXML
:: Attributes # each {|name , value| . . . } -> () (18221.0) -
各属性の名前と値に対しブロックを呼び出します。
...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 do |name, value|
p [name, value]
end
# => ["foo:att", "1"]
# => ["bar:att", "2"]
# => ["att", "<"]
//}... -
CSV
:: Table # each {|column _ name , values| . . . } -> self (18215.0) -
デフォルトのミックスモードかロウモードでは、行単位で繰り返します。カラ ムモードでは、ブロックに列名と対応する値の配列を与え、列単位で繰り返し ます。
...header2"], ["row2_1", "row2_2"])
row3 = CSV::Row.new(["header1", "header2"], ["row3_1", "row3_2"])
table = CSV::Table.new([row1, row2, row3])
table.each { |row| p row }
# => #<CSV::Row "header1":"row1_1" "header2":"row1_2">
# => #<CSV::Row "header1":"row2_1" "header2":"row2_2">
# => #<CSV::Row "hea......_1", "row2_2"])
row3 = CSV::Row.new(["header1", "header2"], ["row3_1", "row3_2"])
table = CSV::Table.new([row1, row2, row3])
table.by_col!
table.each { |column_name, values| print column_name, values, "\n" }
# => header1["row1_1", "row2_1", "row3_1"]
# => header2["row1_2", "row2_2", "row3_2"]
//}... -
Struct
# each {|value| . . . } -> self (18210.0) -
構造体の各メンバに対して繰り返します。
...ct.new は Struct の下位クラスを作成する点に
注意してください。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
joe.each {|x| puts(x) }
# => Joe Smith
# 123 Maple, Anytown NC
# 12345
//}... -
Win32
:: Registry # each {|name , type , value| . . . } (18206.0) -
@todo
@todo
キーが持つレジストリ値を列挙します。 -
DBM
# each {|key , value| . . . } -> self (18205.0) -
各要素に対するイテレータ。
各要素に対するイテレータ。 -
GDBM
# each {|key , value| . . . } -> self (18205.0) -
各要素に対するイテレータです。
各要素に対するイテレータです。 -
SDBM
# each {|key , value| . . . } -> self (18205.0) -
各要素に対するイテレータ。
各要素に対するイテレータ。