# File lib/sinatra/respond_to.rb, line 188 def respond_to(&block) wants = {} def wants.method_missing(type, *args, &handler) ::Sinatra::Base.send(:fail, "Unknown media type for respond_to: #{type}\nTry registering the extension with a mime type") if ::Sinatra::Base.mime_type(type).nil? self[type] = handler end yield wants raise UnhandledFormat if wants[format].nil? wants[format].call end