Method: Jets::Commands::Call::AutoloadGuesser#underscored_name

Defined in:
lib/jets/commands/call/autoload_guesser.rb

#underscored_nameObject

Strips the action because we dont want it to guess the class name So:

admin-related-pages => admin_related_pages_controller


70
71
72
73
74
75
76
77
78
# File 'lib/jets/commands/call/autoload_guesser.rb', line 70

def underscored_name
  # strip action and concidentally the _controller_ string
  name = @provided_function_name.sub(process_type_pattern,'')
  # Ensure _controller or _job at the end except for simple functions
  unless process_type == "function"
    name = name.gsub('-','_') + "_#{process_type}"
  end
  name
end