class Maxwell::Agent::Host::Serializer

Public Class Methods

deserialize(json) click to toggle source
# File lib/maxwell/agent/host.rb, line 19
def self.deserialize(json)
  hash = JSON.parse(json, symbolize_names: true)
  Host.new(new.coerce_values!(hash))
end
serialize(attrs) click to toggle source
# File lib/maxwell/agent/host.rb, line 14
def self.serialize(attrs)
  attrs.services = attrs.services.map(&:serialize)
  JSON.dump attrs
end