return value if class is an ancestor of the hash class