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 from_task(task)
      class_name = task.class_name
      filename = class_name.underscore
      valid_types = %w[controller job rule]
      type = filename.split('_').last
      type = "function" unless valid_types.include?(type)
      path = "app/#{type.pluralize}/#{filename}.rb"
      from_path(path)
    end
def from_task ( task ) class_name = task . class_name filename = class_name . underscore valid_types = %w[ controller job rule ] type = filename . split ( '_' ) . last type = "function" unless valid_types . include? ( type ) path = "app/#{type.pluralize}/#{filename}.rb" from_path ( path ) 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 .
# Examples of filename: posts_controller, hard_job, security_rule, #   hello_function, hello
task
<not_specific>