lib/roda/plugins/render.rb
# :nocov:
# Compile a method in the given module with the given name that will
# call the compiled template method, updating the compiled template method
:nocov:
Compile a method in the given module with the given name that will
call the compiled template method, updating the compiled template method
: nocov : Compile a method in the given module with the given name that will call the compiled template method updating the compiled template method
def define_compiled_method(roda_class, method_name, locals_keys=EMPTY_ARRAY)
            mod = roda_class::RodaCompiledTemplates
            internal_method_name = :"_#{method_name}"
            begin
              mod.send(:define_method, internal_method_name, send(:compiled_method, locals_keys, roda_class))
            rescue ::NotImplementedError
              return false
            end
            mod.send(:private, internal_method_name)
            mod.send(:define_method, method_name, &compiled_method_lambda(self, roda_class, internal_method_name, locals_keys))
            mod.send(:private, method_name)
            method_name
          end
def define_compiled_method ( roda_class , method_name , locals_keys = EMPTY_ARRAY ) mod = roda_class :: RodaCompiledTemplates internal_method_name = :" _ #{ method_name } " begin mod . send ( :define_method , internal_method_name , send ( :compiled_method , locals_keys , roda_class ) ) rescue :: NotImplementedError return false end mod . send ( :private , internal_method_name ) mod . send ( :define_method , method_name , & compiled_method_lambda ( self , roda_class , internal_method_name , locals_keys ) ) mod . send ( :private , method_name ) method_name end
:nocov:
Compile a method in the given module with the given name that will
call the compiled template method, updating the compiled template method
: nocov : Compile a method in the given module with the given name that will call the compiled template method updating the compiled template method
roda_class
method_name
locals_keys