Refactor encoding.rb week 4 select_values method