Class: ActionHooks::Generators::WebhookGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- ActionHooks::Generators::WebhookGenerator
- Defined in:
- lib/generators/action_hooks/webhook/webhook_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_route ⇒ Object
26 27 28 29 |
# File 'lib/generators/action_hooks/webhook/webhook_generator.rb', line 26 def add_route return unless [:controller] route %(post "webhooks/#{file_name}", to: "webhooks/#{file_name}#create") end |
#create_controller_file ⇒ Object
21 22 23 24 |
# File 'lib/generators/action_hooks/webhook/webhook_generator.rb', line 21 def create_controller_file return unless [:controller] template "controller.rb.erb", "app/controllers/webhooks/#{file_name}_controller.rb" end |
#create_job_file ⇒ Object
16 17 18 19 |
# File 'lib/generators/action_hooks/webhook/webhook_generator.rb', line 16 def create_job_file return if [:skip_job] template "job.rb.erb", "app/jobs/#{file_name}_webhook_job.rb" end |