Hash#assert_required_keys refactor