Module: RabbitFeed::ConsoleConsumer
- Extended by:
- ConsoleConsumer
- Included in:
- ConsoleConsumer
- Defined in:
- lib/rabbit_feed/console_consumer.rb
Defined Under Namespace
Classes: Formatter
Constant Summary collapse
- APPLICATION_NAME =
'rabbit_feed_console'.freeze
Instance Method Summary collapse
- #event_count_message ⇒ Object
- #formatted(event) ⇒ Object
- #increment_event_count ⇒ Object
- #init ⇒ Object
Instance Method Details
#event_count_message ⇒ Object
20 21 22 |
# File 'lib/rabbit_feed/console_consumer.rb', line 20 def "#{@event_count} events received." end |
#formatted(event) ⇒ Object
16 17 18 |
# File 'lib/rabbit_feed/console_consumer.rb', line 16 def formatted(event) Formatter.new(event).to_s end |
#increment_event_count ⇒ Object
24 25 26 |
# File 'lib/rabbit_feed/console_consumer.rb', line 24 def increment_event_count @event_count += 1 end |
#init ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/rabbit_feed/console_consumer.rb', line 7 def init @event_count = 0 set_application route_all_events puts ask_to_purge_queue unless queue_empty? puts 'Ready. Press CTRL+C to exit.' end |