Class: Hanami::Minitest::Generators::Action Private
- Inherits:
-
Object
- Object
- Hanami::Minitest::Generators::Action
- Defined in:
- lib/hanami/minitest/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(key:, namespace:, base_path:) ⇒ 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.
14 15 16 17 |
# File 'lib/hanami/minitest/generators/action.rb', line 14 def initialize(fs:, inflector:) @fs = fs @inflector = inflector end |
Instance Method Details
#call(key:, namespace:, base_path:) ⇒ 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.
21 22 23 24 25 26 27 |
# File 'lib/hanami/minitest/generators/action.rb', line 21 def call(key:, namespace:, base_path:) ruby_class_file = action_ruby_class_file(key: key, namespace: namespace, base_path: base_path) test_file_path = ruby_class_file.path.gsub(/\.rb$/, "_test.rb") action_class_name = ruby_class_file.fully_qualified_name fs.write(test_file_path, test_content(action_class_name)) end |