Class: Interactor::Generator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Interactor::Generator
show all
- Defined in:
- lib/generators/interactor.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.source_root ⇒ Object
3
4
5
|
# File 'lib/generators/interactor.rb', line 3
def self.source_root
File.expand_path("../templates", __FILE__)
end
|
Instance Method Details
#generate ⇒ Object
7
8
9
10
|
# File 'lib/generators/interactor.rb', line 7
def generate
template "#{self.class.generator_name}.erb", File.join("app/interactors", class_path, "#{file_name}.rb")
template "spec.erb", File.join("spec/interactors", class_path, "#{file_name}_spec.rb")
end
|