Class: Metaphor::Processor::PrintMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/metaphor/processor/print_message.rb

Instance Method Summary collapse

Constructor Details

#initialize(target = STDOUT) ⇒ PrintMessage

Returns a new instance of PrintMessage.



4
5
6
# File 'lib/metaphor/processor/print_message.rb', line 4

def initialize(target = STDOUT)
  @target = target
end

Instance Method Details

#call(headers, body) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/metaphor/processor/print_message.rb', line 8

def call(headers, body)
  headers.each_pair do |header, value|
    @target.puts "#{header}:#{value}"
  end
  @target.puts
  @target.puts body
  @target.puts
end