Class: NexusCqrs::CommandGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_command_fileObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/generators/nexus_cqrs/command_generator.rb', line 9

def copy_command_file
  file_path = class_name.underscore

  @permission = options['permission']

  template('command.rb', "app/domain/commands/#{file_path}.rb")
  template('command_handler.rb', "app/domain/commands/#{file_path}_handler.rb")

  register_command
end