Class: Hanami::CLI::Commands::App::Generate::Part Private
- Inherits:
-
Command
- Object
- Dry::CLI::Command
- Hanami::CLI::Command
- Command
- Hanami::CLI::Commands::App::Generate::Part
- Defined in:
- lib/hanami/cli/commands/app/generate/part.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.
Constant Summary
Constants inherited from Command
Instance Method Summary collapse
- #call(name:, slice: nil, skip_tests: DEFAULT_SKIP_TESTS) ⇒ Object private
-
#initialize(fs:, inflector:, generator: Generators::App::Part.new(fs: fs, inflector: inflector), **opts) ⇒ Part
constructor
private
A new instance of Part.
Methods inherited from Command
#app, #database, #database_config, inherited, #measure, #run_command
Methods inherited from Hanami::CLI::Command
Constructor Details
#initialize(fs:, inflector:, generator: Generators::App::Part.new(fs: fs, inflector: inflector), **opts) ⇒ Part
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.
Returns a new instance of Part.
36 37 38 39 40 41 42 43 |
# File 'lib/hanami/cli/commands/app/generate/part.rb', line 36 def initialize( fs:, inflector:, generator: Generators::App::Part.new(fs: fs, inflector: inflector), **opts ) super(fs: fs, inflector: inflector, **opts) @generator = generator end |
Instance Method Details
#call(name:, slice: nil, 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.
47 48 49 50 51 |
# File 'lib/hanami/cli/commands/app/generate/part.rb', line 47 def call(name:, slice: nil, skip_tests: DEFAULT_SKIP_TESTS, **) # rubocop:disable Lint/UnusedMethodArgument slice = inflector.underscore(Shellwords.shellescape(slice)) if slice generator.call(app.namespace, name, slice) end |