class AdLocalize::Mappers::TranslationGroupMapper

Public Class Methods

new(translation_mapper: TranslationMapper.new) click to toggle source
# File lib/ad_localize/mappers/translation_group_mapper.rb, line 4
def initialize(translation_mapper: TranslationMapper.new)
  @translation_mapper = translation_mapper
end

Public Instance Methods

map(label:, translations:) click to toggle source
# 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