Class: Hanami::RSpec::Generators::Slice Private
- Inherits:
-
Object
- Object
- Hanami::RSpec::Generators::Slice
- Defined in:
- lib/hanami/rspec/generators/slice.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(slice, context: Hanami::CLI::Generators::App::SliceContext.new(inflector, nil, slice, nil)) ⇒ Object private
-
#initialize(fs:, inflector:) ⇒ Slice
constructor
private
A new instance of Slice.
Constructor Details
#initialize(fs:, inflector:) ⇒ Slice
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 Slice.
13 14 15 16 |
# File 'lib/hanami/rspec/generators/slice.rb', line 13 def initialize(fs:, inflector:) @fs = fs @inflector = inflector end |
Instance Method Details
#call(slice, context: Hanami::CLI::Generators::App::SliceContext.new(inflector, nil, 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.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/hanami/rspec/generators/slice.rb', line 20 def call(slice, context: Hanami::CLI::Generators::App::SliceContext.new(inflector, nil, slice, nil)) fs.write("spec/slices/#{slice}/action_spec.rb", t("action_spec.erb", context)) # fs.write("spec/slices/#{slice}/view_spec.rb", t("view_spec.erb", context)) # fs.write("spec/slices/#{slice}/repository_spec.rb", t("repository_spec.erb", context)) fs.write("spec/slices/#{slice}/actions/.keep", t("keep.erb", context)) # fs.write("spec/slices/#{slice}/views/.keep", t("keep.erb", context)) # fs.write("spec/slices/#{slice}/templates/.keep", t("keep.erb", context)) # fs.write("spec/slices/#{slice}/templates/layouts/.keep", t("keep.erb", context)) # fs.write("spec/slices/#{slice}/entities/.keep", t("keep.erb", context)) # fs.write("spec/slices/#{slice}/repositories/.keep", t("keep.erb", context)) end |