0
0

.to_h について

Posted at

.to_hメソッドとは

対象のオブジェクト(配列やEnum型)に対してhashの形に変換する

users = [[:name1, Alice], [:name2, Bob], [:name3, Hanako]]
users.to_hash
 →{name1: Alice, name2: Bob, name3: Hanako}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0