Sha256: 832fca870e6a403718f439f6b3f9e3643eea1167c1c2595068300852401c64a5
Contents?: true
Size: 687 Bytes
Versions: 14
Compression:
Stored size: 687 Bytes
Contents
module Wombat module Processing module NodeSelector def select_nodes(selector, namespaces = nil) return [selector.to_s] if selector.is_a? Symbol if selector.is_a? String return @context.xpath selector[6..-1], namespaces if selector.start_with? "xpath=" return @context.css selector[4..-1] if selector.start_with? "css=" end if selector.is_a? Hash method = selector.flatten.first selector = selector.flatten.last return @context.xpath selector, namespaces if method == :xpath return @context.css selector if method == :css end [selector] end end end end
Version data entries
14 entries across 14 versions & 1 rubygems