我经常写这样的东西:
a_hash['x'] ? a_hash['x'] += ' some more text' : a_hash['x'] = 'first text'
应该有更好的方法来做到这一点,但我找不到它.
ruby hash
hash ×1
ruby ×1