class Mushy::WriteJson

Public Class Methods

details() click to toggle source
# File lib/mushy/fluxs/write_json.rb, line 7
def self.details
  {
    name: 'WriteJson',
    description: 'Write the incoming event as JSON.',
    config: {
      key: {
            description: 'The key of the outgoing field that will contain the JSON.',
            type:        'text',
            value:       'json',
          },
    },
  }
end

Public Instance Methods

process(event, config) click to toggle source
# File lib/mushy/fluxs/write_json.rb, line 21
def process event, config
  {
    config[:key] => event.to_json
  }
end