This is a little suboptimal because OM exposes all of the terms on the
top level of the instance, so the method is named cleanup. The
parsers also do not have a base class to ensure that a given cleanup
method is available, so we use a respond_to? check. The last ugly bit is
that calling file_mime_type = ... did not update the value, so the
send("filetype=", ...) was the only way I could get this to pass.
There is a new test with FITS output from running against a sample
netCDF file. There may be other types that report multiple mimetypes in
this way, so the cleanup implementation is general (split on comma, pick
the first). It's possible that using an array would be better, but there
are other expectations in the service that enforce a single value.
This is a little suboptimal because OM exposes all of the terms on the top level of the instance, so the method is named cleanup. The parsers also do not have a base class to ensure that a given cleanup method is available, so we use a respond_to? check. The last ugly bit is that calling
file_mime_type = ...
did not update the value, so thesend("filetype=", ...)
was the only way I could get this to pass.There is a new test with FITS output from running against a sample netCDF file. There may be other types that report multiple mimetypes in this way, so the cleanup implementation is general (split on comma, pick the first). It's possible that using an array would be better, but there are other expectations in the service that enforce a single value.