Class: Enigma::Export

Inherits:
Endpoint show all
Defined in:
lib/enigma/endpoints/export.rb

Overview

The export endpoint has no filtering, but it returns a URL where the download will eventually be available. This client will return a ‘Download` object which can be asked to go get the file

Instance Attribute Summary collapse

Attributes inherited from Endpoint

#datapath, #params, #url

Instance Method Summary collapse

Methods inherited from Endpoint

descendants, #initialize, #path, #serialize_search, #serialize_select, #serialize_where, url_chunk, #url_chunk

Constructor Details

This class inherits a constructor from Enigma::Endpoint

Instance Attribute Details

#downloadObject

Returns the value of attribute download.



8
9
10
# File 'lib/enigma/endpoints/export.rb', line 8

def download
  @download
end

#unzipObject

Returns the value of attribute unzip.



8
9
10
# File 'lib/enigma/endpoints/export.rb', line 8

def unzip
  @unzip
end

Instance Method Details

#requestDownload

The API request responds with a URL to poll until it’s ready. Create a new download object with that URL and return it

Returns:



15
16
17
18
19
20
# File 'lib/enigma/endpoints/export.rb', line 15

def request
  req = Typhoeus::Request.new(url, method: :get, params: params).run
  Enigma.logger.info req.body
  res = Response.parse(req)
  Download.new(res)
end