Module: Wombat::NodeSelector

Included in:
PropertyLocator
Defined in:
lib/wombat/node_selector.rb

Instance Method Summary collapse

Instance Method Details

#select_nodes(selector, namespaces = nil) ⇒ Object



3
4
5
6
7
8
# File 'lib/wombat/node_selector.rb', line 3

def select_nodes(selector, namespaces = nil)
  return [selector.to_s] if selector.is_a? Symbol
  return context.xpath selector[6..-1], namespaces if selector.start_with? "xpath="
  return context.css selector[4..-1] if selector.start_with? "css="
  [selector]
end