Module: LibXML::Ext::Find
- Defined in:
- lib/libxml/ext/find_mixin.rb
Class Method Summary collapse
Instance Method Summary collapse
- #/(xpath) ⇒ Object
- #xfind(xpath) ⇒ Object (also: #[])
Class Method Details
.included(base) ⇒ Object
41 42 43 44 45 46 |
# 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 |
Instance Method Details
#/(xpath) ⇒ Object
37 38 39 |
# File 'lib/libxml/ext/find_mixin.rb', line 37 def /(xpath) xfind(xpath.to_s) end |
#xfind(xpath) ⇒ Object Also known as: []
31 32 33 |
# File 'lib/libxml/ext/find_mixin.rb', line 31 def xfind(xpath) find(xpath.gsub('**', 'descendant::node()')) end |