Class: RabbitFeed::ConsoleConsumer::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/rabbit_feed/console_consumer.rb

Constant Summary collapse

BORDER_WIDTH =
100
BORDER_CHAR =
'-'.freeze
DIVIDER_CHAR =
'*'.freeze
NEWLINE =
"\n".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event) ⇒ Formatter

Returns a new instance of Formatter.



77
78
79
# File 'lib/rabbit_feed/console_consumer.rb', line 77

def initialize(event)
  @event = event
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



75
76
77
# File 'lib/rabbit_feed/console_consumer.rb', line 75

def event
  @event
end

Instance Method Details

#to_sObject



81
82
83
# File 'lib/rabbit_feed/console_consumer.rb', line 81

def to_s
  [header, , divider, payload, footer].join(NEWLINE)
end