Sha256: 9563a047cbce3a676f13437cc5e723cd50b3992c76dbbc2cea86e18f36de9f25

Contents?: true

Size: 740 Bytes

Versions: 94

Compression:

Stored size: 740 Bytes

Contents

module Translator
  class TranslatorCoordinator
    attr_reader :paths

    def initialize(paths:, frequency:)
      @paths     = paths
      @frequency = frequency
    end

    def requests
      @requests ||= @paths.map do |path|
        Translator::FileTranslator.new(path).translation_requests
      end.flatten
    end

    def requests_by_frequency
      @requests_by_frequency ||= requests.group_by(&:frequency)
    end

    def create_smartling_jobs!
      Translator::SmartlingCoordinator.call(
        requests: requests_by_frequency.fetch(@frequency, []),
        frequency: @frequency
      )
    end

    def download_smartling_files!
      Translator::SmartlingDownloader.call(
        paths: @paths
      )
    end
  end
end

Version data entries

94 entries across 94 versions & 1 rubygems

Version Path
station-0.5.16 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.15 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.14 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.13 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.12 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.11 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.10 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.9 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.8 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.7 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.6 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.5 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.4 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.3 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.2 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.1 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.5.0 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.4.9 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.4.8 lib/nexmo_developer/app/services/translator/translator_coordinator.rb
station-0.4.7 lib/nexmo_developer/app/services/translator/translator_coordinator.rb