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


39
40
41
# File 'lib/jets/commands/call/guesser.rb', line 39

def initialize(provided_function_name)
  @provided_function_name = provided_function_name
end

Instance Method Details

#delegate_guesserObject



43
44
45
46
47
48
49
# File 'lib/jets/commands/call/guesser.rb', line 43

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