Class: Hanami::CLI::Commands::Generate::Action Private
- Inherits:
-
Command
- Object
- Hanami::CLI::Command
- Command
- Hanami::CLI::Commands::Generate::Action
- Defined in:
- lib/hanami/cli/commands/generate/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.
Instance Method Summary collapse
-
#call(app:, action:, **options) ⇒ Object
private
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength.
Methods inherited from Command
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.
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/hanami/cli/commands/generate/action.rb', line 32 def call(app:, action:, **) *controller, action = controller_and_action_name(action) classified_controller_name = classified_controller(controller) http_method = route_http_method(action, ) context = Context.new(app: app, controller: controller, classified_controller_name: classified_controller_name, action: action, test: .fetch(:test), http_method: http_method, options: ) context = context.with(template: project.template(context)) assert_valid_app!(context) assert_valid_route_url!(context) assert_valid_route_http_method!(context) generate_action(context) generate_view(context) generate_template(context) generate_action_spec(context) generate_view_spec(context) insert_route(context) end |