Class: Geoblacklight::CsvDownload

Inherits:
Download
  • Object
show all
Defined in:
lib/geoblacklight/download/csv_download.rb

Constant Summary collapse

CSV_DOWNLOAD_PARAMS =
{service: "wfs",
version: "2.0.0",
request: "GetFeature",
srsName: "EPSG:4326",
outputformat: "csv"}.freeze

Instance Method Summary collapse

Methods inherited from Download

#create_download_file, #download_exists?, #downloadable?, #file_name, file_path, #file_path_and_name, #get, #initiate_download, #url_with_params

Constructor Details

#initialize(document, options = {}) ⇒ CsvDownload

Returns a new instance of CsvDownload.



11
12
13
14
15
16
17
18
19
20
# File 'lib/geoblacklight/download/csv_download.rb', line 11

def initialize(document, options = {})
  request_params = CSV_DOWNLOAD_PARAMS.merge(typeName: document.wxs_identifier)
  super(document, {
    type: "csv",
    extension: "csv",
    request_params: request_params,
    content_type: "text/csv",
    service_type: "wfs"
  }.merge(options))
end