Class: Cmdx::WorkflowGenerator

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

Overview

Rails generator that scaffolds a new CMDx::Workflow subclass under app/tasks, honoring nested module paths supplied through the NAME argument (e.g. Billing::Checkout writes to app/tasks/billing/checkout.rb).

Invoked via rails generate cmdx:workflow NAME.

See Also:

Instance Method Summary collapse

Instance Method Details

#copy_filesvoid

This method returns an undefined value.

Renders workflow.rb.tt into app/tasks/<class_path>/<file_name>.rb.



21
22
23
24
# File 'lib/generators/cmdx/workflow_generator.rb', line 21

def copy_files
  path = File.join("app/tasks", class_path, "#{file_name}.rb")
  template("workflow.rb.tt", path)
end