Class: Pronto::Formatter::TextMessageDecorator

Inherits:
SimpleDelegator
  • Object
show all
Includes:
Colorizable
Defined in:
lib/pronto/formatter/text_message_decorator.rb

Constant Summary collapse

LOCATION_COLOR =
:cyan
LEVEL_COLORS =
{
  info: :yellow,
  warning: :magenta,
  error: :red,
  fatal: :red
}.freeze

Instance Method Summary collapse

Methods included from Colorizable

#colorize

Instance Method Details

#to_hObject



15
16
17
18
19
20
# File 'lib/pronto/formatter/text_message_decorator.rb', line 15

def to_h
  original = __getobj__.to_h
  original[:color_level] = format_level(__getobj__)
  original[:color_location] = format_location(__getobj__)
  original
end