Class: Noticed::Generators::NotifierGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Rails::Generators::ResourceHelpers
Defined in:
lib/generators/noticed/notifier_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_abstract_classObject



16
17
18
19
# File 'lib/generators/noticed/notifier_generator.rb', line 16

def generate_abstract_class
  return if File.exist?("app/notifiers/application_notifier.rb")
  template "application_notifier.rb", "app/notifiers/application_notifier.rb"
end

#generate_notificationObject



21
22
23
# File 'lib/generators/noticed/notifier_generator.rb', line 21

def generate_notification
  template "notifier.rb", "app/notifiers/#{file_path}_notifier.rb"
end