Class: Kanina::MessageGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Kanina::MessageGenerator
- Defined in:
- lib/generators/kanina/message/message_generator.rb
Overview
Kanina::MessageGenerator
generates a template of a message file. Change the
resulting file with your intended exchange or routing_key information. For example:
rails generate message user_notification
Then you'll want to update the generated message class with instructions on which exchange to send messages, the type of exchange, and so on.
Instance Method Summary collapse
-
#create_message_file ⇒ Object
This method is automatically run by Rails when generating a new message.
Instance Method Details
#create_message_file ⇒ Object
This method is automatically run by Rails when generating a new message. It sets up the messages folder and adds the message template. Remember to change the template to talk to the right exchange/queue!
17 18 19 20 21 |
# File 'lib/generators/kanina/message/message_generator.rb', line 17 def = Rails.root + 'app/messages' empty_directory template 'message.rb', + "#{file_name}_message.rb" end |