# File lib/scrubyt/core/scraping/constraint.rb, line 113 def check(result) case @type #checked after evaluation, so here always return true when CONSTRAINT_TYPE_ENSURE_PRESENCE_OF_PATTERN return true when CONSTRAINT_TYPE_ENSURE_PRESENCE_OF_ATTRIBUTE attribute_present(result) when CONSTRAINT_TYPE_ENSURE_ABSENCE_OF_ATTRIBUTE !attribute_present(result) when CONSTRAINT_TYPE_ENSURE_PRESENCE_OF_ANCESTOR_NODE ancestor_node_present(result) when CONSTRAINT_TYPE_ENSURE_ABSENCE_OF_ANCESTOR_NODE !ancestor_node_present(result) end end