class Roqua::CsvExport::Config

Configuration for an export run. Each argument to new has a corresponding getter, with export_versions using export_versions_path to load the data.

Constants

ATTRS

Public Class Methods

new(sqlite_path:, export_versions: nil, export_versions_path: nil, organization_key:, output_path:, anonymous_data_in_exports: false) click to toggle source

@param sqlite_path [Pathname] full path to sql_export.db. @param export_versions [ExportVersions] the versions to export. Can pass path instead. @param export_versions_path [Pathname] path to directory with json files, to load export_versions from. @param organization_key [String] will be prepended to csv_file_names. @param output_path [Pathname] to write a directory per export_version to. @param anonymous_data_in_exports [Boolean] when true, external_identifier and respondent#id will be exported

for anonymous responses.
# File lib/roqua/csv_export/config.rb, line 23
def initialize(sqlite_path:,
               export_versions: nil,
               export_versions_path: nil,
               organization_key:,
               output_path:,
               anonymous_data_in_exports: false)
  local_variables.each do |attr|
    instance_variable_set("@#{attr}", binding.local_variable_get(attr))
  end
end

Public Instance Methods

export_versions() click to toggle source
# File lib/roqua/csv_export/config.rb, line 34
def export_versions
  @export_versions ||= ::Roqua::CsvExport::ExportVersions.new(export_versions_path)
end