module Shrine::Plugins::TypePredicates::FileMethods

  1. lib/shrine/plugins/type_predicates.rb

Methods

Public Instance

  1. audio?
  2. image?
  3. text?
  4. type?
  5. video?

Public Instance methods

audio?()
[show source]
   # File lib/shrine/plugins/type_predicates.rb
33 def audio?
34   general_type?("audio")
35 end
image?()
[show source]
   # File lib/shrine/plugins/type_predicates.rb
25 def image?
26   general_type?("image")
27 end
text?()
[show source]
   # File lib/shrine/plugins/type_predicates.rb
37 def text?
38   general_type?("text")
39 end
type?(type)
[show source]
   # File lib/shrine/plugins/type_predicates.rb
41 def type?(type)
42   matching_mime_type = shrine_class.type_lookup(type)
43 
44   fail Error, "type #{type.inspect} is not recognized by the MIME library" unless matching_mime_type
45 
46   mime_type! == matching_mime_type
47 end
video?()
[show source]
   # File lib/shrine/plugins/type_predicates.rb
29 def video?
30   general_type?("video")
31 end