るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.246秒)
トップページ > クラス:Struct[x] > クエリ:_builtin[x] > クエリ:new[x] > クエリ:to_a[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

検索結果

Struct#to_a -> [object] (26126.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] (11026.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 の下位クラスを作成する点に
注意してください。...