Class: AmqpUtils::MessageFormatter::JSON
- Defined in:
- lib/amqp_utils/message_formatter.rb
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#generate(io, header, message) ⇒ Object
44 45 46 47 |
# File 'lib/amqp_utils/message_formatter.rb', line 44 def generate(io, header, ) json_obj = {'header' => header.properties, 'message' => } io.puts ::JSON.generate(json_obj) end |
#load(io) ⇒ Object
49 50 51 52 |
# File 'lib/amqp_utils/message_formatter.rb', line 49 def load(io) next_line = io.gets ::JSON.parse(next_line) if next_line end |