Module: Nokogiri::LibXML::CommonNode

Included in:
XmlAttribute, XmlDtd, XmlElement, XmlEntity, XmlNode, XmlNs
Defined in:
lib/nokogiri/ffi/structs/common_node.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#documentObject



4
5
6
7
# File 'lib/nokogiri/ffi/structs/common_node.rb', line 4

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

#keep_reference_from!(document) ⇒ Object

equivalent to NOKOGIRI_ROOT_NSDEF



31
32
33
34
# File 'lib/nokogiri/ffi/structs/common_node.rb', line 31

def keep_reference_from!(document) # equivalent to NOKOGIRI_ROOT_NSDEF
  raise "no document to add reference to" unless document
  LibXML.xmlXPathNodeSetAdd(document.unlinked_nodes, self)
end

#keep_reference_from_document!Object

equivalent to NOKOGIRI_ROOT_NODE



25
26
27
28
29
# File 'lib/nokogiri/ffi/structs/common_node.rb', line 25

def keep_reference_from_document! # equivalent to NOKOGIRI_ROOT_NODE
  doc = self.document
  raise "no document to add reference to" unless doc
  LibXML.xmlXPathNodeSetAdd(doc.unlinked_nodes, self)
end

#ruby_nodeObject



17
18
19
# File 'lib/nokogiri/ffi/structs/common_node.rb', line 17

def ruby_node
  Nokogiri::WeakBucket.get_object(self)
end

#ruby_node=(object) ⇒ Object



21
22
23
# File 'lib/nokogiri/ffi/structs/common_node.rb', line 21

def ruby_node= object
  Nokogiri::WeakBucket.set_object(self, object)
end

#ruby_node_pointerObject



9
10
11
# File 'lib/nokogiri/ffi/structs/common_node.rb', line 9

def ruby_node_pointer
  self[:_private]
end

#ruby_node_pointer=(value) ⇒ Object



13
14
15
# File 'lib/nokogiri/ffi/structs/common_node.rb', line 13

def ruby_node_pointer=(value)
  self[:_private] = value
end