module Roda::RodaPlugins::SinatraHelpers::ClassMethods

  1. lib/roda/plugins/sinatra_helpers.rb

Methods

Public Instance

  1. mime_type

Public Instance methods

mime_type(type=nil || (return), value = nil)

If a type and value are given, set the value in Rack’s MIME registry. If only a type is given, lookup the type in Rack’s MIME registry and return it.

[show source]
    # File lib/roda/plugins/sinatra_helpers.rb
511 def mime_type(type=nil || (return), value = nil)
512   return type.to_s if type.to_s.include?('/')
513   type = ".#{type}" unless type.to_s[0] == ?.
514   if value
515     Rack::Mime::MIME_TYPES[type] = value
516   else
517     Rack::Mime.mime_type(type, nil)
518   end
519 end