Class: EcsAutoscalingScheduler::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/ecs_autoscaling_scheduler/cli.rb,
lib/ecs_autoscaling_scheduler/cli/bye.rb,
lib/ecs_autoscaling_scheduler/cli/index.rb,
lib/ecs_autoscaling_scheduler/cli/create.rb,
lib/ecs_autoscaling_scheduler/cli/option.rb,
lib/ecs_autoscaling_scheduler/cli/destroy.rb,
lib/ecs_autoscaling_scheduler/cli/destroy_outdated.rb

Defined Under Namespace

Classes: Bye, Create, Destroy, DestroyOutdated, Index, Option

Constant Summary collapse

COMMAND =
{
  index: "index",
  create: "create",
  destroy: "destroy",
  destroy_outdated: "destroy_outdated",
  bye: "bye",
}

Instance Method Summary collapse

Instance Method Details

#runObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/ecs_autoscaling_scheduler/cli.rb', line 23

def run
  option = parse_option
  case option.command || ask_command
  when COMMAND[:index]
    Index.new.run(option)
  when COMMAND[:create]
    Create.new.run(option)
  when COMMAND[:destroy]
    Destroy.new.run(option)
  when COMMAND[:destroy_outdated]
    DestroyOutdated.new.run(option)
  else
    Bye.new.run
  end
end