class Maxwell::Agent::Host::Service::Serializer

Public Class Methods

deserialize(json) click to toggle source
# File lib/maxwell/agent/host/service.rb, line 27
def self.deserialize(json)
  hash = JSON.parse(json, symbolize_names: true)
  Service.new(new.coerce_values!(hash))
end
serialize(attrs) click to toggle source
# File lib/maxwell/agent/host/service.rb, line 21
def self.serialize(attrs)
  attrs.last_run   = attrs.last_run.to_s if attrs.last_run
  attrs.perform_at = attrs.perform_at.to_s if attrs.perform_at
  JSON.dump attrs
end