Method: BetterHtml::Parser#nodes_with_type

Defined in:
lib/better_html/parser.rb

#nodes_with_type(*type) ⇒ Object



43
44
45
46
# File 'lib/better_html/parser.rb', line 43

def nodes_with_type(*type)
  types = Array.wrap(type)
  ast.children.select { |node| node.is_a?(::AST::Node) && types.include?(node.type) }
end