Sha256: d82b178e31f7c31aed09723cff4cdbe70771ae96833df5a5b8dad05c9e857759
Contents?: true
Size: 659 Bytes
Versions: 13
Compression:
Stored size: 659 Bytes
Contents
require_relative '../setup/setup_generator.rb' module Service module Generators class UsecaseGenerator < Rails::Generators::NamedBase source_root File.expand_path('templates', __dir__) argument :usecases, type: :array, default: [], banner: 'usecase usecase' def call invoke Service::Generators::SetupGenerator, [name] usecases.each do |u| @usecase = u.classify path = "app/services/#{service_name}/usecases/#{u.underscore}.rb" template 'usecase.rb.erb', path end end private def service_name "#{name.underscore}_service" end end end end
Version data entries
13 entries across 13 versions & 1 rubygems