Module: Mato::Concerns::HtmlNodeCheckable
- Included in:
- HtmlFilters::MentionLink, HtmlFilters::TokenLink
- Defined in:
- lib/mato/concerns/html_node_checkable.rb
Class Method Summary collapse
-
.has_ancestor?(node, *tags) ⇒ Boolean
True if the node has the specified tags as a parent.
Class Method Details
.has_ancestor?(node, *tags) ⇒ Boolean
Returns true if the node has the specified tags as a parent.
11 12 13 14 15 16 17 18 19 |
# File 'lib/mato/concerns/html_node_checkable.rb', line 11 def has_ancestor?(node, *) current = node while (current = current.parent) if .include?(current.name) return true end end false end |