Class: HttpApiTools::SerializerLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/http_api_tools/serializer_loader.rb

Class Method Summary collapse

Class Method Details

.preloadObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/http_api_tools/serializer_loader.rb', line 4

def self.preload

  file_names = Dir.entries(Rails.root.join('app', 'serializers')).select { |file_name| file_name.end_with?('serializer.rb') }.reverse

  file_names.each do |file_name|
    require file_name
  end

rescue StandardError => e

  #no serializers directory found to load

end