Class: Datacite::Mapping::IdentifierNode

Inherits:
XML::Mapping::ObjectNode
  • Object
show all
Includes:
EmptyNodeUtils
Defined in:
lib/datacite/mapping/identifier.rb

Overview

Custom node to warn (but not blow up) if we read an XML <resource/> that's missing its <identifier/>.

Instance Method Summary collapse

Methods included from EmptyNodeUtils

#not_empty

Instance Method Details

#xml_to_obj(_obj, xml)


67
68
69
70
# File 'lib/datacite/mapping/identifier.rb', line 67

def xml_to_obj(_obj, xml)
  return super if (element = has_element?(xml)) && not_empty(element)
  warn 'Identifier not found; add a valid Identifier to the Resource before saving'
end