Module: Datacite::Mapping::EmptyNodeUtils

Included in:
EmptyFilteringArrayNode, IdentifierNode
Defined in:
lib/datacite/mapping/empty_filtering_nodes.rb

Instance Method Summary collapse

Instance Method Details

#not_empty(element)



9
10
11
12
13
14
15
16
# File 'lib/datacite/mapping/empty_filtering_nodes.rb', line 9

def not_empty(element)
  return unless element

  text = element.text
  empty = text.nil? || text.strip.empty?
  warn "Ignoring empty element #{element}" if empty
  !empty
end