lib/jets/klass.rb
# from_path allows us to load any app classes in consistent way for
# app/controllers, app/jobs, and app/functions.
from_path allows us to load any app classes in consistent way for
app/controllers, app/jobs, and app/functions.
from_path allows us to load any app classes in consistent way for app / controllers app / jobs and app / functions .
def load_anonymous_class(class_name, path)
      constructor = Jets::Lambda::FunctionConstructor.new(path)
      unless @@loaded_anonymous_classes.include?(class_name)
        Object.const_set(class_name, constructor.build)
        @@loaded_anonymous_classes << class_name
      end
    end
def load_anonymous_class ( class_name , path ) constructor = Jets :: Lambda :: FunctionConstructor . new ( path ) unless @@loaded_anonymous_classes . include? ( class_name ) Object . const_set ( class_name , constructor . build ) @@loaded_anonymous_classes << class_name end end
from_path allows us to load any app classes in consistent way for
app/controllers, app/jobs, and app/functions.
from_path allows us to load any app classes in consistent way for app / controllers app / jobs and app / functions .
# Dont load anonyomous class more than once to avoid these warnings: #   warning: already initialized constant Hello #   warning: previous definition of Hello was here # use class_name as the variable name for prettier class name.
class_name
<not_specific>
path
<not_specific>