Class: Hanami::RSpec::Generators::Action Private
- Inherits:
-
Object
- Object
- Hanami::RSpec::Generators::Action
- Defined in:
- lib/hanami/rspec/generators/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.
Instance Method Summary collapse
- #call(app, slice, controller, action, context: Hanami::CLI::Generators::App::ActionContext.new(inflector, app, slice, controller, action)) ⇒ Object private
-
#initialize(fs:, inflector:) ⇒ Action
constructor
private
A new instance of Action.
Constructor Details
#initialize(fs:, inflector:) ⇒ Action
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 Action.
13 14 15 16 |
# File 'lib/hanami/rspec/generators/action.rb', line 13 def initialize(fs:, inflector:) @fs = fs @inflector = inflector end |
Instance Method Details
#call(app, slice, controller, action, context: Hanami::CLI::Generators::App::ActionContext.new(inflector, app, slice, controller, action)) ⇒ 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.
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/hanami/rspec/generators/action.rb', line 20 def call(app, slice, controller, action, context: Hanami::CLI::Generators::App::ActionContext.new(inflector, app, slice, controller, action)) # rubocop:disable Layout/LineLength if slice fs.write( "spec/slices/#{slice}/actions/#{controller_directory(controller)}/#{action}_spec.rb", t("action_slice_spec.erb", context) ) else fs.write( "spec/actions/#{controller_directory(controller)}/#{action}_spec.rb", t("action_spec.erb", context) ) end end |