Class: Service::Generators::ServiceGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/service/service_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_commandsObject



30
31
32
# File 'lib/generators/service/service_generator.rb', line 30

def generate_commands
  invoke Service::Generators::CommandGenerator, [name, usecases]
end

#generate_usecasesObject



26
27
28
# File 'lib/generators/service/service_generator.rb', line 26

def generate_usecases
  invoke Service::Generators::UsecaseGenerator, [name, usecases]
end

#install_if_notObject



16
17
18
19
20
# File 'lib/generators/service/service_generator.rb', line 16

def install_if_not
  return if File.exist?('app/services')

  generate 'service:install'
end

#setupObject



22
23
24
# File 'lib/generators/service/service_generator.rb', line 22

def setup
  invoke Service::Generators::SetupGenerator, [name]
end