Class: PushToSns::Generators::NotifierGenerator

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

Overview

rails generate push_to_sns:notifier new_goal goal

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



11
12
13
# File 'lib/rails/generators/push_to_sns/notifier_generator.rb', line 11

def self.source_root
  @source_root ||= File.expand_path("../templates", __FILE__)
end

Instance Method Details

#create_notifierObject



15
16
17
18
19
# File 'lib/rails/generators/push_to_sns/notifier_generator.rb', line 15

def create_notifier
  template "notifier.rb", File.join(
    "app/push_notifiers", "#{file_name}_notifier.rb"
  )
end