module SerialBox::Serializers::JSON::ClassMethods

Public Instance Methods

json_create(object) click to toggle source

Converts a primitive object (deserialized from JSON) into an instance of this class.

Note: You should not call this method directly. You should use ‘JSON.parse` to ensure recursive deserialization works properly.

@param [Array, Hash] object The JSON-ready primitive represnetation of

an instance of this class.

@return An instance of this class derived from the JSON.

# File lib/serializers/json.rb, line 55
def json_create(object)
  instance = allocate
  _serialbox_serializer.deserialization_operations.each do |operation|
    operation.apply instance, object
  end
  return instance
end