Class: ApiPresenter::Generators::PresenterGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- ApiPresenter::Generators::PresenterGenerator
- Defined in:
- lib/generators/api_presenter/presenter/presenter_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_application_presenter ⇒ Object
6 7 8 9 10 |
# File 'lib/generators/api_presenter/presenter/presenter_generator.rb', line 6 def create_application_presenter unless File.exist?('app/presenters/application_api_presenter.rb') copy_file('application_presenter.rb', 'app/presenters/application_api_presenter.rb') end end |
#create_presenter ⇒ Object
12 13 14 |
# File 'lib/generators/api_presenter/presenter/presenter_generator.rb', line 12 def create_presenter template('presenter.rb', File.join('app/presenters', class_path, "#{file_name}_presenter.rb")) end |