class AdLocalize::Mappers::OptionsToExportRequest

Public Instance Methods

map(options:) click to toggle source
# File lib/ad_localize/mappers/options_to_export_request.rb, line 4
def map(options:)
  Requests::ExportRequest.new(
    platforms: options[:only],
    g_spreadsheet_options: map_g_spreadsheet_options(options: options),
    verbose: options[:debug],
    output_path: options[:'target-dir'],
    merge_policy: options[:'merge-policy'],
    csv_paths: options[:csv_paths]
  )
end

Private Instance Methods

map_g_spreadsheet_options(options:) click to toggle source
# File lib/ad_localize/mappers/options_to_export_request.rb, line 17
def map_g_spreadsheet_options(options:)
  return unless options[:'drive-key']
  Requests::GSpreadsheetOptions.new(
    spreadsheet_id: options[:'drive-key'],
    sheet_ids: options[:'sheets'],
    export_all: options[:'export-all-sheets'],
    service_account_config: ENV['GCLOUD_CLIENT_SECRET']
  )
end