Class: ZerviceGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_application_service_fileObject



8
9
10
# File 'lib/generators/zervice_generator.rb', line 8

def create_application_service_file
  template "application_service.rb.erb", "app/services/application_service.rb", skip: true
end

#create_service_fileObject



12
13
14
# File 'lib/generators/zervice_generator.rb', line 12

def create_service_file
  template "service.rb.erb", "app/services/#{file_path}.rb"
end

#create_test_fileObject



16
17
18
# File 'lib/generators/zervice_generator.rb', line 16

def create_test_file
  template "service_test.rb.erb", "test/services/#{file_path}_test.rb"
end