Class: Hanami::CLI::Commands::App::Generate::Action Private

Inherits:
Command show all
Defined in:
lib/hanami/cli/commands/app/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.

Since:

  • 2.0.0

Instance Method Summary collapse

Methods inherited from Command

#app, #inflector, inherited, #measure, #run_command

Methods inherited from Hanami::CLI::Command

#inflector, #initialize, new

Constructor Details

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

Instance Method Details

#call(name:, slice: nil, url_path: nil, http_method: nil, skip_view: DEFAULT_SKIP_VIEW, skip_route: DEFAULT_SKIP_ROUTE, skip_tests: DEFAULT_SKIP_TESTS) ⇒ 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/ParameterLists

Raises:

Since:

  • 2.0.0



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/hanami/cli/commands/app/generate/action.rb', line 82

def call(
  name:,
  slice: nil,
  url_path: nil,
  http_method: nil,
  skip_view: DEFAULT_SKIP_VIEW,
  skip_route: DEFAULT_SKIP_ROUTE,
  skip_tests: DEFAULT_SKIP_TESTS
)
  name = Naming.new(inflector:).action_name(name)

  raise InvalidActionNameError.new(name) unless name.include?(".")

  super(
    name: name,
    slice: slice,
    url_path: url_path,
    skip_route: skip_route,
    http_method: http_method,
    skip_view: skip_view || !Hanami.bundled?("hanami-view"),
    skip_tests: skip_tests
  )
end

#generator_classObject

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:

  • 2.0.0



75
76
77
# File 'lib/hanami/cli/commands/app/generate/action.rb', line 75

def generator_class
  Generators::App::Action
end