Class: AdLocalize::Mappers::TranslationGroupMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/ad_localize/mappers/translation_group_mapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(translation_mapper: TranslationMapper.new) ⇒ TranslationGroupMapper

Returns a new instance of TranslationGroupMapper.



4
5
6
# File 'lib/ad_localize/mappers/translation_group_mapper.rb', line 4

def initialize(translation_mapper: TranslationMapper.new)
  @translation_mapper = translation_mapper
end

Instance Method Details

#map(label:, translations:) ⇒ Object



8
9
10
11
# File 'lib/ad_localize/mappers/translation_group_mapper.rb', line 8

def map(label:, translations:)
  translation_view_models = translations.map { |translation| @translation_mapper.map(translation: translation) }
  ViewModels::TranslationGroupViewModel.new(label: label, translation_view_models: translation_view_models)
end