Simplified the code by using each_with_object
found a good explanation of it on http://batsov.com/articles/2013/12/04/using-rubys-each-with-object/
create the anagram class