Module: Nokogiri::LibXML::XmlXpathContextMixin

Included in:
XmlXpathContext, XmlXpathContextCast
Defined in:
lib/nokogiri/ffi/structs/xml_xpath_context.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/nokogiri/ffi/structs/xml_xpath_context.rb', line 4

def self.included(base)
  base.class_eval do

    layout(
      :doc,  :pointer,
      :node, :pointer
      )

  end
end

Instance Method Details

#documentObject



19
20
21
22
# File 'lib/nokogiri/ffi/structs/xml_xpath_context.rb', line 19

def document
  p = self[:doc]
  p.null? ? nil : LibXML::XmlDocumentCast.new(p)
end

#nodeObject



15
16
17
# File 'lib/nokogiri/ffi/structs/xml_xpath_context.rb', line 15

def node
  LibXML::XmlNode.new(self[:node])
end