module Roda::RodaPlugins::DefaultHeaders::ClassMethods
def freeze
Optimize the response class set_default_headers method if it hasn't been
def freeze if (headers = opts[:default_headers]).all?{|k, v| k.is_a?(String) && v.is_a?(String)} && (self::RodaResponse.instance_method(:set_default_headers).owner == Base::ResponseMethods) self::RodaResponse.class_eval(<<-END, __FILE__, __LINE__+1) private def set_default_headers h = @headers #{headers.map{|k,v| "h[#{k.inspect}] ||= #{v.inspect}"}.join('; ')} end END end super end