Class: DelegatedPresenterGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/delegated_presenter_generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(args, *options) ⇒ DelegatedPresenterGenerator

:nodoc:



4
5
6
7
# File 'lib/generators/delegated_presenter_generator.rb', line 4

def initialize(args, *options) #:nodoc:
  args[0] = args[0].gsub(/\./,'_')
  super
end

Instance Method Details

#create_presenter_fileObject



9
10
11
# File 'lib/generators/delegated_presenter_generator.rb', line 9

def create_presenter_file
  template "presenter.rb.erb", "app/presenters/#{file_name}_presenter.rb"
end