add from_hash method to attributes module