Class: Hanami::CLI::Commands::App::Generate::Slice Private
- Inherits:
-
Command
- Object
- Dry::CLI::Command
- Hanami::CLI::Command
- Command
- Hanami::CLI::Commands::App::Generate::Slice
- Defined in:
- lib/hanami/cli/commands/app/generate/slice.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:, url: nil, skip_db: SKIP_DB_DEFAULT, skip_route: DEFAULT_SKIP_ROUTE) ⇒ Object private
-
#initialize(fs:, inflector:, generator: Generators::App::Slice.new(fs: fs, inflector: inflector), **opts) ⇒ Slice
constructor
private
A new instance of Slice.
Methods inherited from Command
#app, inherited, #measure, #run_command
Methods inherited from Hanami::CLI::Command
Constructor Details
#initialize(fs:, inflector:, generator: Generators::App::Slice.new(fs: fs, inflector: inflector), **opts) ⇒ Slice
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 Slice.
51 52 53 54 55 56 57 58 |
# File 'lib/hanami/cli/commands/app/generate/slice.rb', line 51 def initialize( fs:, inflector:, generator: Generators::App::Slice.new(fs: fs, inflector: inflector), **opts ) super(fs: fs, inflector: inflector, **opts) @generator = generator end |
Instance Method Details
#call(name:, url: nil, skip_db: SKIP_DB_DEFAULT, skip_route: DEFAULT_SKIP_ROUTE) ⇒ 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.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/hanami/cli/commands/app/generate/slice.rb', line 62 def call( name:, url: nil, skip_db: SKIP_DB_DEFAULT, skip_route: DEFAULT_SKIP_ROUTE ) require "hanami/setup" app = inflector.underscore(Hanami.app.namespace) name = inflector.underscore(Shellwords.shellescape(name)) url = sanitize_url_prefix(name, url) generator.call(app, name, url, skip_db: skip_db, skip_route: skip_route) end |