Module: Hydra::Works::MimeTypes::ClassMethods

Defined in:
lib/hydra/works/models/concerns/file_set/mime_types.rb

Instance Method Summary collapse

Instance Method Details

#audio_mime_typesObject



39
40
41
42
43
# File 'lib/hydra/works/models/concerns/file_set/mime_types.rb', line 39

def audio_mime_types
  # audio/x-wave is the mime type that fits 0.6.0 returns for a wav file.
  # audio/mpeg is the mime type that fits 0.6.0 returns for an mp3 file.
  ['audio/mp3', 'audio/mpeg', 'audio/wav', 'audio/x-wave', 'audio/x-wav', 'audio/ogg']
end

#image_mime_typesObject



27
28
29
# File 'lib/hydra/works/models/concerns/file_set/mime_types.rb', line 27

def image_mime_types
  ['image/png', 'image/jpeg', 'image/jpg', 'image/jp2', 'image/bmp', 'image/gif', 'image/tiff']
end

#office_document_mime_typesObject



45
46
47
48
49
50
51
52
53
54
# File 'lib/hydra/works/models/concerns/file_set/mime_types.rb', line 45

def office_document_mime_types
  ['text/rtf',
   'application/msword',
   'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
   'application/vnd.oasis.opendocument.text',
   'application/vnd.ms-excel',
   'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
   'application/vnd.ms-powerpoint',
   'application/vnd.openxmlformats-officedocument.presentationml.presentation']
end

#pdf_mime_typesObject



31
32
33
# File 'lib/hydra/works/models/concerns/file_set/mime_types.rb', line 31

def pdf_mime_types
  ['application/pdf']
end

#video_mime_typesObject



35
36
37
# File 'lib/hydra/works/models/concerns/file_set/mime_types.rb', line 35

def video_mime_types
  ['video/mpeg', 'video/mp4', 'video/webm', 'video/x-msvideo', 'video/avi', 'video/quicktime', 'application/mxf']
end