Module: AnotherUploader::MimeTypeGetters

Included in:
Upload
Defined in:
lib/another_uploader/mime_type_getters.rb

Constant Summary collapse

MTG =
MimeTypeGroups

Instance Method Summary collapse

Instance Method Details

#is_excel?Boolean

Returns:

  • (Boolean)


14
# File 'lib/another_uploader/mime_type_getters.rb', line 14

def is_excel?; is_of_type?(MTG::EXCEL_TYPES); end

#is_image?Boolean

Returns:

  • (Boolean)


10
# File 'lib/another_uploader/mime_type_getters.rb', line 10

def is_image?; is_of_type?(MTG::IMAGE_TYPES); end

#is_mp3?Boolean

Returns:

  • (Boolean)


13
# File 'lib/another_uploader/mime_type_getters.rb', line 13

def is_mp3?; is_of_type?(MTG::MP3_TYPES); end

#is_of_type?(type_list) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/another_uploader/mime_type_getters.rb', line 6

def is_of_type? type_list
  type_list.include?(self.local_content_type)
end

#is_pdf?Boolean

Returns:

  • (Boolean)


11
# File 'lib/another_uploader/mime_type_getters.rb', line 11

def is_pdf?; is_of_type?(MTG::PDF_TYPES); end

#is_text?Boolean

Returns:

  • (Boolean)


15
# File 'lib/another_uploader/mime_type_getters.rb', line 15

def is_text?; is_of_type?(MTG::TEXT_TYPES); end

#is_word?Boolean

Returns:

  • (Boolean)


12
# File 'lib/another_uploader/mime_type_getters.rb', line 12

def is_word?; is_of_type?(MTG::WORD_TYPES); end