Ruby sort by multiple values? January 24, 2023 by Tarik a.sort { |a, b| [a['foo'], a['bar']] <=> [b['foo'], b['bar']] }