Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
これは私のハッシュです:
h_letters = { first: { value: 2, text: "H" }, second: { value: 2, text: "HH" }, third: { value: 4, text: "HHH" } }
そして、ハッシュ全体の最大値のテキストを取得したいと考えています。
ご協力いただきありがとうございます
h_letters.max_by { |h| h.last[:value] }.last[:text] #=> "HHH"