Class: Burner::Library::Serialize::Json

Inherits:
JobWithRegister show all
Defined in:
lib/burner/library/serialize/json.rb

Overview

Treat value like a Ruby object and serialize it using JSON.

Expected Payload input: anything. Payload output: string representing the output of the JSON serializer.

Constant Summary

Constants inherited from JobWithRegister

JobWithRegister::BLANK

Instance Attribute Summary

Attributes inherited from JobWithRegister

#register

Attributes inherited from Job

#name

Instance Method Summary collapse

Methods inherited from JobWithRegister

#initialize

Methods inherited from Job

#initialize

Methods included from Util::Arrayable

#array

Constructor Details

This class inherits a constructor from Burner::JobWithRegister

Instance Method Details

#perform(_output, payload) ⇒ Object



18
19
20
# File 'lib/burner/library/serialize/json.rb', line 18

def perform(_output, payload)
  payload[register] = payload[register].to_json
end