Class: Hanami::CLI::Commands::App::Generate::View Private
- Inherits:
-
Command
- Object
- Dry::CLI::Command
- Hanami::CLI::Command
- Command
- Hanami::CLI::Commands::App::Generate::View
- Defined in:
- lib/hanami/cli/commands/app/generate/view.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:, format: DEFAULT_FORMAT, slice: nil) ⇒ Object private
-
#initialize(fs:, inflector:, generator: Generators::App::View.new(fs: fs, inflector: inflector), **opts) ⇒ View
constructor
private
A new instance of View.
Methods inherited from Command
#app, inherited, #measure, #run_command
Methods inherited from Hanami::CLI::Command
Constructor Details
#initialize(fs:, inflector:, generator: Generators::App::View.new(fs: fs, inflector: inflector), **opts) ⇒ View
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 View.
35 36 37 38 39 40 41 42 |
# File 'lib/hanami/cli/commands/app/generate/view.rb', line 35 def initialize( fs:, inflector:, generator: Generators::App::View.new(fs: fs, inflector: inflector), **opts ) super(fs: fs, inflector: inflector, **opts) @generator = generator end |
Instance Method Details
#call(name:, format: DEFAULT_FORMAT, slice: nil) ⇒ 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.
46 47 48 49 50 |
# File 'lib/hanami/cli/commands/app/generate/view.rb', line 46 def call(name:, format: DEFAULT_FORMAT, slice: nil, **) slice = inflector.underscore(Shellwords.shellescape(slice)) if slice generator.call(app.namespace, name, format, slice) end |