Class: Rails::PresenterGenerator

Inherits:
Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/presenter/presenter_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_service_fileObject



7
8
9
# File 'lib/generators/presenter/presenter_generator.rb', line 7

def copy_service_file
  template 'presenter.rb', "app/presenters/#{file_path}_presenter.rb"
end

#copy_service_test_fileObject



11
12
13
14
15
16
17
# File 'lib/generators/presenter/presenter_generator.rb', line 11

def copy_service_test_file
  if options.test_suite == 'rspec'
    template 'presenter_spec.rb', "spec/presenters/#{file_path}_presenter_spec.rb"
  elsif options.test_suite == 'minitest'
    template 'presenter_test.rb', "test/presenters/#{file_path}_presenter_test.rb"
  end
end