Class: CDD::Export

Inherits:
Base
  • Object
show all
Defined in:
lib/cdd/export.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#client, #id

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from CDD::Base

Instance Attribute Details

#formatObject

Returns the value of attribute format.



3
4
5
# File 'lib/cdd/export.rb', line 3

def format
  @format
end

#searchObject

Returns the value of attribute search.



5
6
7
# File 'lib/cdd/export.rb', line 5

def search
  @search
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/cdd/export.rb', line 4

def status
  @status
end

#vaultObject

Returns the value of attribute vault.



6
7
8
# File 'lib/cdd/export.rb', line 6

def vault
  @vault
end

Instance Method Details

#dataObject



16
17
18
19
# File 'lib/cdd/export.rb', line 16

def data
  response = RestClient.get "#{client.url}#{data_url}", { :params => {}, "X-CDD-Token" => client.token }
  response.to_s if response
end

#data_urlObject



21
22
23
# File 'lib/cdd/export.rb', line 21

def data_url
  "/api/v1/vaults/#{vault.id}/exports/#{id}"
end

#pollObject



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

def poll
  client.execute(poll_url)
end

#poll_urlObject



12
13
14
# File 'lib/cdd/export.rb', line 12

def poll_url
  "/api/v1/vaults/#{vault.id}/export_progress/#{self.id}"
end