And if it is a hash, you don't even need this. node.attributes.keys would be an empty array and the block would be skipped.