Class: Jets::Commands::Call::Guesser

Inherits:
Object
  • Object
show all
Defined in:
lib/jets/commands/call/guesser.rb

Instance Method Summary collapse

Constructor Details

#initialize(provided_function_name) ⇒ Guesser

Example of provided_function_name:

admin/related_pages_controller-list_all
admin-related-pages-controller-list-all


36
37
38
# File 'lib/jets/commands/call/guesser.rb', line 36

def initialize(provided_function_name)
  @provided_function_name = provided_function_name
end

Instance Method Details

#delegate_guesserObject



40
41
42
43
44
45
46
# File 'lib/jets/commands/call/guesser.rb', line 40

def delegate_guesser
  @delegate_guesser ||= if @provided_function_name =~ /[-_](controller|job|rule)/
                          AutoloadGuesser.new(@provided_function_name)
                        else
                          AnonymousGuesser.new(@provided_function_name)
                        end
end