Method: Exekutor::Configuration#load_json_serializer

Defined in:
lib/exekutor/configuration.rb

#load_json_serializerObject

Gets the JSON serializer. Is derived from the #json_serializer option.

Returns:

  • (Object)

Raises:

  • (Error)

    when the class cannot be found, or does not respond to #dump and #load



85
86
87
88
89
90
91
92
93
94
95
# File 'lib/exekutor/configuration.rb', line 85

def load_json_serializer
  raw_value = json_serializer
  if defined?(@json_serializer_instance) && @json_serializer_instance[0] == raw_value
    return @json_serializer_instance[1]
  end

  serializer = const_get :json_serializer
  serializer = SerializerValidator.convert! serializer unless SerializerValidator.valid? serializer
  @json_serializer_instance = [raw_value, serializer]
  serializer
end