Class: Hanami::CLI::Commands::Destroy::Action Private

Inherits:
Command
  • Object
show all
Defined in:
lib/hanami/cli/commands/destroy/action.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 1.1.0

Instance Method Summary collapse

Methods inherited from Command

inherited, #initialize

Constructor Details

This class inherits a constructor from Hanami::CLI::Commands::Command

Instance Method Details

#call(app:, action:, **options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.1.0


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/hanami/cli/commands/destroy/action.rb', line 20

def call(app:, action:, **options)
  app                = Utils::String.underscore(app)
  *controller, action = controller_and_action(action)
  action_name        = controller_and_action_name(controller, action)

  context = Context.new(app: app, controller: controller, action: action, action_name: action_name, options: options)

  assert_valid_app!(context)

  remove_route(context)
  destroy_view_spec(context)
  destroy_action_spec(context)
  destroy_templates(context)
  destroy_view(context)
  destroy_action(context)
end