Class: Plurimath::XmlEngine::OxEngine

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

Defined Under Namespace

Classes: Element

Class Method Summary collapse

Class Method Details

.dump(data, **options) ⇒ Object



14
15
16
# File 'lib/plurimath/xml_engine/ox_engine.rb', line 14

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

.is_xml_comment?(node) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
27
28
# File 'lib/plurimath/xml_engine/ox_engine.rb', line 24

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

  false
end

.load(data) ⇒ Object



18
19
20
21
22
# File 'lib/plurimath/xml_engine/ox_engine.rb', line 18

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

.new_element(name) ⇒ Object



10
11
12
# File 'lib/plurimath/xml_engine/ox_engine.rb', line 10

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

.replace_nodes(root, nodes) ⇒ Object



30
31
32
33
# File 'lib/plurimath/xml_engine/ox_engine.rb', line 30

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