Sha256: 5f8f139f900fe992c3b57d2b439ebcca4eeaf823574ae2a5683289d500c19adf

Contents?: true

Size: 466 Bytes

Versions: 24

Compression:

Stored size: 466 Bytes

Contents

module Mime
  class << self
    def method_missing m, *args
      raise "invalid usage of Mime!" unless args.empty?
      self[m]
    end
  
    def [] type
      type = ".#{type}" unless type =~ /^\./
      Rack::Mime.mime_type(type) || raise("Unknown MIME type: #{type}")
    end
    
    def image? file_name      
      return false if file_name.blank? 
      extension = File.extname(file_name)
      Rack::Mime.mime_type(extension) =~ /image/
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rad_core-0.2.6 lib/rad/_support/mime.rb
rad_core-0.2.5 lib/rad/_support/mime.rb
rad_core-0.2.4 lib/rad/_support/mime.rb
rad_core-0.2.3 lib/rad/_support/mime.rb
rad_core-0.2.2 lib/rad/_support/mime.rb
rad_core-0.2.1 lib/rad/_support/mime.rb
rad_core-0.2.0 lib/rad/_support/mime.rb
rad_core-0.0.30 lib/rad/_support/mime.rb
rad_core-0.0.29 lib/rad/_support/mime.rb
rad_core-0.0.28 lib/rad/_support/mime.rb
rad_core-0.0.27 lib/rad/_support/mime.rb
rad_core-0.0.26 lib/rad/_support/mime.rb
rad_core-0.0.25 lib/rad/_support/mime.rb
rad_core-0.0.24 lib/rad/_support/mime.rb
rad_core-0.0.23 lib/rad/_support/mime.rb
rad_core-0.0.22 lib/rad/_support/mime.rb
rad_core-0.0.21 lib/rad/_support/mime.rb
rad_core-0.0.20 lib/rad/_support/mime.rb
rad_core-0.0.19 lib/rad/_support/mime.rb
rad_core-0.0.18 lib/rad/_support/mime.rb