module Shrine::Plugins::TypePredicates

  1. lib/shrine/plugins/type_predicates.rb

Documentation can be found on shrinerb.com/docs/plugins/type_predicates

Methods

Public Class

  1. configure

Public Class methods

configure(uploader, methods: [], **opts)
[show source]
   # File lib/shrine/plugins/type_predicates.rb
 7 def self.configure(uploader, methods: [], **opts)
 8   uploader.opts[:type_predicates] ||= { mime: :mini_mime }
 9   uploader.opts[:type_predicates].merge!(opts)
10 
11   methods.each do |name|
12     uploader::UploadedFile.send(:define_method, "#{name}?") { type?(name) }
13   end
14 end