Great opportunity for symbol to proc. @cards.map(&:rank).uniq would be more idiomatic Ruby.