Class: Plurimath::XmlEngine::Ox

Inherits:
Object
  • Object
show all
Defined in:
lib/plurimath/xml_engine/ox.rb,
lib/plurimath/xml_engine/ox/element.rb

Defined Under Namespace

Classes: Element

Class Method Summary collapse

Class Method Details

.dump(data, **options) ⇒ Object



16
17
18
# File 'lib/plurimath/xml_engine/ox.rb', line 16

def dump(data, **options)
  ::Ox.dump(data.xml_nodes, **options)
end

.is_xml_comment?(node) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
29
30
# File 'lib/plurimath/xml_engine/ox.rb', line 26

def is_xml_comment?(node)
  return node.is_xml_comment? if node.is_a?(Element)

  false
end

.load(data) ⇒ Object



20
21
22
23
24
# File 'lib/plurimath/xml_engine/ox.rb', line 20

def load(data)
  Element.new(
    ::Ox.load(data, strip_namespace: true),
  )
end

.new_element(name) ⇒ Object



12
13
14
# File 'lib/plurimath/xml_engine/ox.rb', line 12

def new_element(name)
  Element.new(name)
end

.replace_nodes(root, nodes) ⇒ Object



32
33
34
35
# File 'lib/plurimath/xml_engine/ox.rb', line 32

def replace_nodes(root, nodes)
  root.replace_nodes(Array(nodes))
  root
end