11件ヒット
[1-11件を表示]
(0.140秒)
ライブラリ
- ビルトイン (11)
検索結果
-
Struct
# each {|value| . . . } -> self (108.0) -
構造体の各メンバに対して繰り返します。
... Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Mapl......e, Anytown NC", 12345)
joe.each {|x| puts(x) }
# => Joe Smith
# 123 Maple, Anytown NC
# 12345
//}...