Module: FastGettext::TranslationRepository
- Defined in:
- lib/fast_gettext/translation_repository.rb,
lib/fast_gettext/translation_repository/db.rb,
lib/fast_gettext/translation_repository/mo.rb,
lib/fast_gettext/translation_repository/po.rb,
lib/fast_gettext/translation_repository/base.rb,
lib/fast_gettext/translation_repository/yaml.rb,
lib/fast_gettext/translation_repository/chain.rb,
lib/fast_gettext/translation_repository/merge.rb,
lib/fast_gettext/translation_repository/logger.rb
Overview
Responsibility:
- decide which repository to choose from given input
Defined Under Namespace
Classes: Base, Chain, Db, Logger, Merge, Mo, Po, Yaml
Class Method Summary collapse
Class Method Details
.build(name, options) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/fast_gettext/translation_repository.rb', line 7 def self.build(name, ) type = [: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, ) end |