Sha256: 111194036b0a3cf3a2f02b5acc4bba94c1ed6d1d4f7a20a8d46b2bb9d49c5f78
Contents?: true
Size: 433 Bytes
Versions: 16
Compression:
Stored size: 433 Bytes
Contents
class RestPack::Serializer::Factory def self.create(*identifiers) serializers = identifiers.map { |identifier| self.classify(identifier) } serializers.count == 1 ? serializers.first : serializers end private def self.classify(identifier) begin "#{identifier}Serializer".classify.constantize.new rescue "#{identifier.to_s.singularize.to_sym}Serializer".classify.constantize.new end end end
Version data entries
16 entries across 16 versions & 1 rubygems