Adds a #to_hash method to a Class/Struct/OpenStruct that returns a hash based on the method values rather than instance variable values.