lib/berkeley_library/tind/export/export_format.rb
# Converts a string or symbol to an {ExportFormat}, or returns
# an {ExportFormat} if passed on
#
# @param format [String, Symbol, ExportFormat] the format
# @return [ExportFormat] the format
Converts a string or symbol to an {ExportFormat}, or returns
an {ExportFormat} if passed on
Converts a string or symbol to an { ExportFormat } or returns an { ExportFormat } if passed on
def ensure_format(format)
            return unless format
            return format if format.is_a?(ExportFormat)
            fmt = ExportFormat.find_by_value(format.to_s.downcase)
            return fmt if fmt
            raise ArgumentError, "Unknown #{ExportFormat}: #{format.inspect}"
          end
def ensure_format ( format ) return unless format return format if format . is_a? ( ExportFormat ) fmt = ExportFormat . find_by_value ( format . to_s . downcase ) return fmt if fmt raise ArgumentError , "Unknown #{ExportFormat}: #{format.inspect}" end
Converts a string or symbol to an {ExportFormat}, or returns
an {ExportFormat} if passed on
Converts a string or symbol to an { ExportFormat } or returns an { ExportFormat } if passed on
None
ExportFormat
format
None