Class: ServiceGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_initializer_fileObject



6
7
8
9
# File 'lib/generators/service/service_generator.rb', line 6

def copy_initializer_file
  template "service.erb", "app/services/#{file_name}.rb"
  template "service_test.erb", "test/services/#{file_name}_test.rb"
end

#service_nameObject



11
12
13
# File 'lib/generators/service/service_generator.rb', line 11

def service_name
  file_name.camelize
end