module HexaPDF::DictionaryFields::FileSpecificationConverter

def self.convert(data, type, document)

returns +nil+.
Converts a string file specification or a hash into a full file specification. Otherwise
def self.convert(data, type, document)
  return if data.kind_of?(type.first) ||
    !(data.kind_of?(Hash) || data.kind_of?(HexaPDF::Dictionary) || data.kind_of?(String))
  data = {F: data} if data.kind_of?(String)
  document.wrap(data, type: type.first)
end