Class: Hanami::CLI::Generators::App::View Private
- Inherits:
-
Object
- Object
- Hanami::CLI::Generators::App::View
- Defined in:
- lib/hanami/cli/generators/app/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.
Instance Method Summary collapse
- #call(key:, namespace:, base_path:, template_engine: DEFAULT_TEMPLATE_ENGINE, force: false) ⇒ Object private
-
#initialize(fs:, inflector:, out: $stdout) ⇒ View
constructor
private
A new instance of View.
Constructor Details
#initialize(fs:, inflector:, out: $stdout) ⇒ 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.
25 26 27 28 29 |
# File 'lib/hanami/cli/generators/app/view.rb', line 25 def initialize(fs:, inflector:, out: $stdout) @fs = fs @inflector = inflector @out = out end |
Instance Method Details
#call(key:, namespace:, base_path:, template_engine: DEFAULT_TEMPLATE_ENGINE, force: false) ⇒ 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.
33 34 35 36 37 38 39 |
# File 'lib/hanami/cli/generators/app/view.rb', line 33 def call(key:, namespace:, base_path:, template_engine: DEFAULT_TEMPLATE_ENGINE, force: false) view_class_file(key:, namespace:, base_path:).then do |view_class| view_class.create(force:) view_class_name = view_class.fully_qualified_name create_template_file(key:, base_path:, view_class_name:, template_engine:, force:) end end |