Class: Pronto::Formatter::TextFormatter

Inherits:
Base
  • Object
show all
Defined in:
lib/pronto/formatter/text_formatter.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#config

Class Method Details

.nameObject



6
7
8
# File 'lib/pronto/formatter/text_formatter.rb', line 6

def self.name
  'text'
end

Instance Method Details

#format(messages, _repo, _patches) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/pronto/formatter/text_formatter.rb', line 10

def format(messages, _repo, _patches)
  messages.map do |message|
    message_format = config.message_format(self.class.name)
    message_data = TextMessageDecorator.new(message).to_h
    (message_format % message_data).strip
  end
end