Sha256: 6d843ae1fd8d480a05e64fb712f5c6bb3ce080e3930c396359cbbb7d448209b0
Contents?: true
Size: 519 Bytes
Versions: 10
Compression:
Stored size: 519 Bytes
Contents
# frozen_string_literal: true module FastGettext # Responsibility: # - decide which repository to choose from given input module TranslationRepository def self.build(name, options) type = options[:type] || :mo class_name = type.to_s.split('_').map(&:capitalize).join unless FastGettext::TranslationRepository.constants.map(&:to_s).include?(class_name) require "fast_gettext/translation_repository/#{type}" end const_get(class_name).new(name, options) end end end
Version data entries
10 entries across 10 versions & 1 rubygems