class Metanorma::Generic::Converter

def metadata_ext_hash1(key, value, ext, hash, node)

def metadata_ext_hash1(key, value, ext, hash, node)
  h = hash.is_a?(Hash)
  h && hash["_attribute"] and return
  is_hash = h && !hash.keys.reject { |n| EXT_STRUCT.include?(n) }.empty?
  !is_hash && (value.nil? || value.empty?) and return
  name = h ? (hash["_output"] || key) : key
  ext.send name, **attr_code(metadata_ext_attrs(hash, node)) do |e|
    is_hash ? metadata_ext_hash(node, e, hash) : (e << value)
  end
end