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

Instance Method Details

#event_count_messageObject



20
21
22
# File 'lib/rabbit_feed/console_consumer.rb', line 20

def event_count_message
  "#{@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_countObject



24
25
26
# File 'lib/rabbit_feed/console_consumer.rb', line 24

def increment_event_count
  @event_count += 1
end

#initObject



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 welcome_message
  ask_to_purge_queue unless queue_empty?
  puts 'Ready. Press CTRL+C to exit.'
end