I have an HTML document and I need to examine, whether some attribute is presented in element in question
Suppose, that the attribute is not presented.
When i say:
elem.has_attribute? "data-attr"
it returns nil instead of "false".
When i say:
elem["data-attr"].nil?
it returns "true", that is what i need.
But, when i say:
!elem["data-attr"].nil?
it retuns nil again.
When i say:
r = elem["data-attr"].nil?
r = !r
r gets "true" after the first line is executed
but, after the second line, "r" gets nil again
What the magic behind it ?