Is there a way to check that the class implements Hash or Array interfaces (via duck typing).