mergeメソッドとは、ハッシュを結合させることができる、Rubyのメソッドである
post = { name: "さとう", text: "こんにちは"}
uid = { user_id: "1" }
post.merge(uid)
#=> {:name=>"さとう", :text=>"こんにちは", :user_id=>"1"}
Go to list of users who liked
More than 3 years have passed since last update.
mergeメソッドとは、ハッシュを結合させることができる、Rubyのメソッドである
post = { name: "さとう", text: "こんにちは"}
uid = { user_id: "1" }
post.merge(uid)
#=> {:name=>"さとう", :text=>"こんにちは", :user_id=>"1"}
Register as a new user and use Qiita more conveniently
Go to list of users who liked