9件ヒット
[1-9件を表示]
(0.094秒)
ライブラリ
- ビルトイン (9)
検索結果
先頭5件
-
Struct
# inspect -> String (640.0) -
self の内容を人間に読みやすい文字列にして返します。
...注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe =......Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
joe.inspect # => "#<struct Customer name=\"Joe Smith\", address=\"123 Maple, Anytown NC\", zip=12345>"
//}... -
Struct
# to _ h -> Hash (640.0) -
self のメンバ名(Symbol)と値の組を Hash にして返します。
...す。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_h
# => {:name=>"Joe Smith", :address=>"123 Maple, Anytown NC", :zip=>12345}
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンス......に対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。... -
Struct
# to _ s -> String (640.0) -
self の内容を人間に読みやすい文字列にして返します。
...注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe =......Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
joe.inspect # => "#<struct Customer name=\"Joe Smith\", address=\"123 Maple, Anytown NC\", zip=12345>"
//}... -
Struct
# each -> Enumerator (622.0) -
構造体の各メンバに対して繰り返します。
...注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe =... -
Struct
# each {|value| . . . } -> self (622.0) -
構造体の各メンバに対して繰り返します。
...注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe =... -
Struct
# length -> Integer (622.0) -
構造体のメンバの数を返します。
...注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe =... -
Struct
# size -> Integer (622.0) -
構造体のメンバの数を返します。
...注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe =... -
Struct
# to _ a -> [object] (622.0) -
構造体のメンバの値を配列にいれて返します。
...= 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 の下位クラスを作成する点に
注意してください。... -
Struct
# values -> [object] (622.0) -
構造体のメンバの値を配列にいれて返します。
...= 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 の下位クラスを作成する点に
注意してください。...