[COOK-3451] Use Hash#key to silence Hash#index deprecation warnings

Signed-off-by: Seth Vargo <sethvargo@gmail.com>