Add to_hash method to Message