Closed dbarros closed 7 years ago
Actually, I've changed my mind on this. Don't pull this request. Back soon with a revised version. Thanks.
@dbarros I'm trying to help clean up the backlog and ship an updated version of this gem. Since you don't want this pulled, can you just close it please?
As you know, the :else options is useful when an element is not in the XML at all. For example:
I've added an option which handles a situation where the XML is something like this:
As you can see, the element is there, it just has no content, which is different to the previous example.
My change allows me to do this:
Of course, you can combine the two:
The reason why I called it empty is to match the Ruby "".empty? method.
I needed this because I had numerous places where I was checking for nil? The XML that I was consuming had many elements with no content. Now I can avoid those nil? checks using :empty.