Class: GovukMessageQueueConsumer::JSONProcessor
- Inherits:
-
Object
- Object
- GovukMessageQueueConsumer::JSONProcessor
- Defined in:
- lib/govuk_message_queue_consumer/json_processor.rb
Constant Summary collapse
- JSON_FORMAT =
"application/json".freeze
Instance Method Summary collapse
Instance Method Details
#process(message) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/govuk_message_queue_consumer/json_processor.rb', line 5 def process() if .headers.content_type == JSON_FORMAT .payload = JSON.parse(.payload) end true rescue JSON::ParserError => e GovukError.notify(e) if defined?(GovukError) .discard false end |