Module: Wombat::Processing::NodeSelector

Included in:
Wombat::Property::Locators::Base
Defined in:
lib/wombat/processing/node_selector.rb

Instance Method Summary collapse

Instance Method Details

#select_nodes(selector, namespaces = nil) ⇒ Object



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

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