module LibXML::Ext::Find

Public Class Methods

included(base) click to toggle source
# File lib/libxml/ext/find_mixin.rb, line 41
def self.included(base)
  # overwrite original methods
  instance_methods.each { |method|
    base.send(:define_method, method, instance_method(method))
  }
end

Public Instance Methods

/(xpath) click to toggle source
# File lib/libxml/ext/find_mixin.rb, line 37
def /(xpath)
  xfind(xpath.to_s)
end
[](xpath)
Alias for: xfind
xfind(xpath) click to toggle source
# File lib/libxml/ext/find_mixin.rb, line 31
def xfind(xpath)
  find(xpath.gsub('**', 'descendant::node()'))
end
Also aliased as: []