change .hash to to_hash

hash is already a method on Object which hashes the object.
Blindly calling hash on this could yield you nil.hash