Class: BoomNats::InstallGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/boom_nats/nats_generator.rb,
lib/generators/boom_nats/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#consumerObject



17
18
19
# File 'lib/generators/boom_nats/nats_generator.rb', line 17

def consumer
  puts "asd: #{asd}"
end

#installObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/boom_nats/nats_generator.rb', line 5

def install
  copy_file "initializer.rb", "config/initializers/boom_nats.rb"
  create_file "app/consumers/hello_consumer.rb", <<~FILE
    class HelloConsumer < BoomNats::Topic
      def consume
        { message: "Hello \#{params["name"]}, how are you?" }
      end
    end
  FILE
end