handle Hash objects as well as OpenStruct