Add support for to_attr.