Class: Metanorma::Collection::Config::Manifest

Inherits:
Shale::Mapper
  • Object
show all
Includes:
Converters
Defined in:
lib/metanorma/collection/config/manifest.rb

Instance Method Summary collapse

Methods included from Converters

#bibdata_from_xml, #bibdata_from_yaml, #bibdata_to_xml, #bibdata_to_yaml, #nop_to_yaml

Instance Method Details

#docref_from_yaml(model, value) ⇒ Object



80
81
82
# File 'lib/metanorma/collection/config/manifest.rb', line 80

def docref_from_yaml(model, value)
  model.entry = Manifest.from_yaml(value.to_yaml)
end

#entry_from_xml(model, node) ⇒ Object



61
62
63
# File 'lib/metanorma/collection/config/manifest.rb', line 61

def entry_from_xml(model, node)
  model.entry = Manifest.from_xml(node.content)
end

#entry_to_xml(model, parent, doc) ⇒ Object



65
66
67
68
69
70
# File 'lib/metanorma/collection/config/manifest.rb', line 65

def entry_to_xml(model, parent, doc)
  Array(model.entry).each do |e|
    elem = e.to_xml
    doc.add_element(parent, elem)
  end
end

#fileref_from_yaml(model, value) ⇒ Object



76
77
78
# File 'lib/metanorma/collection/config/manifest.rb', line 76

def fileref_from_yaml(model, value)
  model.file ||= value
end

#level_from_yaml(model, value) ⇒ Object



72
73
74
# File 'lib/metanorma/collection/config/manifest.rb', line 72

def level_from_yaml(model, value)
  model.type ||= value
end