Class: RailsServices::Generators::DestroyGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Fileable, Nameable
Defined in:
lib/generators/rails_services/destroy_generator.rb

Overview

destroys a service class

Instance Method Summary collapse

Methods included from Fileable

#form_object_file, #form_spec_file, #form_unit_file, #object_directory, #service_object_file, #service_spec_file, #service_unit_file

Methods included from Nameable

#form_class_name, #module_name, #qualified_name, #service_class_name, #subfolder_name

Instance Method Details

#destroy_serviceObject



17
18
19
20
21
22
23
# File 'lib/generators/rails_services/destroy_generator.rb', line 17

def destroy_service
  remove_file "app/services/#{full_object_directory}/#{service_object_file}"
  remove_file "spec/services/#{full_object_directory}/#{service_spec_file}"
  remove_file "test/services/#{full_object_directory}/#{service_unit_file}"

  manage_containing_directories('app', 'spec', 'test')
end