lib/roda.rb
def freeze
          return self if frozen?

          unless opts[:subclassed]
            # If the _roda_run_main_route instance method has not been overridden,
            # make it an alias to _roda_main_route for performance
            if instance_method(:_roda_run_main_route).owner == InstanceMethods
              class_eval("alias _roda_run_main_route _roda_main_route")
            end
            self::RodaResponse.class_eval do
              if instance_method(:set_default_headers).owner == ResponseMethods &&
                 instance_method(:default_headers).owner == ResponseMethods

                private

                alias set_default_headers set_default_headers
                def set_default_headers
                  @headers['Content-Type'] ||= 'text/html'
                end
              end
            end

            if @middleware.empty? && use_new_dispatch_api?
              plugin :direct_call
            end

            if ([:on, :is, :_verb, :_match_class_String, :_match_class_Integer, :_match_string, :_match_regexp, :empty_path?, :if_match, :match, :_match_class]).all?{|m| self::RodaRequest.instance_method(m).owner == RequestMethods}
              plugin :_optimized_matching
            end
          end

          build_rack_app
          @opts.freeze
          @middleware.freeze

          super
        end
# Freeze the internal state of the class, to avoid thread safety issues at runtime.
# It's optional to call this method, as nothing should be modifying the
# internal state at runtime anyway, but this makes sure an exception will
# be raised if you try to modify the internal state after calling this.
#
# Note that freezing the class prevents you from subclassing it, mostly because
# it would cause some plugins to break.
Freeze the internal state of the class, to avoid thread safety issues at runtime.
It's optional to call this method, as nothing should be modifying the
internal state at runtime anyway, but this makes sure an exception will
be raised if you try to modify the internal state after calling this.

Note that freezing the class prevents you from subclassing it, mostly because
it would cause some plugins to break.
Freeze the internal state of the class to avoid thread safety issues at runtime . It ' s optional to call this method as nothing should be modifying the internal state at runtime anyway but this makes sure an exception will be raised if you try to modify the internal state after calling this . Note that freezing the class prevents you from subclassing it mostly because it would cause some plugins to break .
def freeze
          return self if frozen?
          unless opts[:subclassed]
            if instance_method(:_roda_run_main_route).owner == InstanceMethods
              class_eval("alias _roda_run_main_route _roda_main_route")
            end
            self::RodaResponse.class_eval do
              if instance_method(:set_default_headers).owner == ResponseMethods &&
                 instance_method(:default_headers).owner == ResponseMethods
                private
                alias set_default_headers set_default_headers
                def set_default_headers
                  @headers['Content-Type'] ||= 'text/html'
                end
              end
            end
            if @middleware.empty? && use_new_dispatch_api?
              plugin :direct_call
            end
            if ([:on, :is, :_verb, :_match_class_String, :_match_class_Integer, :_match_string, :_match_regexp, :empty_path?, :if_match, :match, :_match_class]).all?{|m| self::RodaRequest.instance_method(m).owner == RequestMethods}
              plugin :_optimized_matching
            end
          end
          build_rack_app
          @opts.freeze
          @middleware.freeze
          super
        end
def freeze return self if frozen? unless opts [ :subclassed ] if instance_method ( :_roda_run_main_route ) . owner == InstanceMethods class_eval ( "alias _roda_run_main_route _roda_main_route" ) end self :: RodaResponse . class_eval do if instance_method ( :set_default_headers ) . owner == ResponseMethods && instance_method ( :default_headers ) . owner == ResponseMethods private alias set_default_headers set_default_headers def set_default_headers @headers [ 'Content-Type' ] ||= 'text/html' end end end if @middleware . empty? && use_new_dispatch_api? plugin :direct_call end if ( [ :on , :is , :_verb , :_match_class_String , :_match_class_Integer , :_match_string , :_match_regexp , :empty_path? , :if_match , :match , :_match_class ] ) . all? { | m | self :: RodaRequest . instance_method ( m ) . owner == RequestMethods } plugin :_optimized_matching end end build_rack_app @opts . freeze @middleware . freeze super end
Freeze the internal state of the class, to avoid thread safety issues at runtime.
Freeze the internal state of the class to avoid thread safety issues at runtime .
# If the _roda_run_main_route instance method has not been overridden, # make it an alias to _roda_main_route for performance