Module: Shrine::Plugins::TypePredicates::ClassMethods

Defined in:
lib/shrine/plugins/type_predicates.rb

Instance Method Summary collapse

Instance Method Details

#type_lookup(extension, database = nil) ⇒ Object


17
18
19
20
21
# File 'lib/shrine/plugins/type_predicates.rb', line 17

def type_lookup(extension, database = nil)
  database ||= opts[:type_predicates][:mime]
  database   = MimeDatabase.new(database) if database.is_a?(Symbol)
  database.call(extension.to_s)
end