Method: Mime::Type#=~

Defined in:
lib/dependency/mime_type.rb

#=~(mime_type) ⇒ Object



202
203
204
205
206
207
208
# File 'lib/dependency/mime_type.rb', line 202

def =~(mime_type)
  return false if mime_type.blank?
  regexp = Regexp.new(Regexp.quote(mime_type.to_s))
  (@synonyms + [ self ]).any? do |synonym|
    synonym.to_s =~ regexp
  end
end