Class: Ace::Assign::CLI::Commands::Add

Inherits:
Support::Cli::Command
  • Object
show all
Includes:
AssignmentTarget, Support::Cli::Base
Defined in:
lib/ace/assign/cli/commands/add.rb

Overview

Add step trees dynamically to a running assignment.

Instance Method Summary collapse

Instance Method Details

#call(**options) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/ace/assign/cli/commands/add.rb', line 28

def call(**options)
  validate_mode_options!(options)
  validate_child_requires_after!(options)

  target = resolve_assignment_target(options)
  executor = build_executor_for_target(target)

  mode = selected_mode(options)
  case mode
  when :yaml
    handle_yaml_mode(executor, options)
  when :step
    handle_step_mode(executor, options)
  when :task
    handle_task_mode(executor, options)
  else
    raise Ace::Support::Cli::Error, "Exactly one of --yaml, --step, or --task is required"
  end
end