module OodCluster::JsonSerializer::ClassMethods

Namespace for class methods that extend object

Public Instance Methods

json_create(object) click to toggle source

Initialize object with data attribute hash @param object [Hash{#to_sym=>Object}] hash used defining object @return [self] newly instantiated object

# File lib/ood_cluster/json_serializer.rb, line 16
def json_create(object)
  new object["data"].each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
end