Method: Jets::Processors::Deducer#class_name

Defined in:
lib/jets/processors/deducer.rb

#class_nameObject

Example underscored_class_name:

class_name = underscored_class_name
class_name = class_name # PostsController


44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/jets/processors/deducer.rb', line 44

def class_name
  regexp = shared? ?
    Regexp.new(".*handlers/shared/functions/") :
    Regexp.new(".*handlers/#{process_type.pluralize}/")

  # Example regexp:
  #   /.*handlers\/controllers\//
  #   /.*handlers\/jobs\//
  class_name = @handler_path.sub(regexp, "")
  # Example class names:
  #   posts_controller
  #   hard_job
  #   hello
  #   hello_function

  class_name.camelize
end