Class: Hanami::CLIBulma::Generators::App::Action Private

Inherits:
Hanami::CLI::Generators::App::Action
  • Object
show all
Defined in:
lib/hanami/cli_bulma/generators/app/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:

  • 0.0.1

Instance Method Summary collapse

Instance Method Details

#call(app, controller, action, url, http, format, skip_view, slice, context: 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.

Since:

  • 0.0.1



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/hanami/cli_bulma/generators/app/action.rb', line 13

def call(app, controller, action, url, http, format, skip_view, slice, context: nil)
  context ||= Hanami::CLI::Generators::App::ActionContext.new(inflector, app, slice, controller, action)
  if slice
    generate_for_slice(controller, action, url, http, format, skip_view, slice, context)
  else
    generate_for_app(controller, action, url, http, format, skip_view, context)
  end

  view_directory = fs.join("app", "views", controller)
  if generate_view?(skip_view, action, view_directory)
    view_generator = Generators::App::View.new(fs: fs, inflector: inflector)
    view_name = [controller, action].join(Hanami::CLI::Commands::App::Command::ACTION_SEPARATOR)
    view_generator.call(app, view_name, format, slice)
  end
end