Class: CDD::Vault

Inherits:
Base
  • Object
show all
Defined in:
lib/cdd/vault.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

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#data_setsObject



5
6
7
8
9
# File 'lib/cdd/vault.rb', line 5

def data_sets
  @data_sets ||= client.execute(data_sets_url).collect do |hash|
    CDD::DataSet.new(self.client, {:vault => self}.merge(hash))
  end
end

#data_sets_urlObject



11
12
13
# File 'lib/cdd/vault.rb', line 11

def data_sets_url
  "/api/v1/vaults/#{self.id}/data_sets"
end

#export_url(format = "csv") ⇒ Object



35
36
37
# File 'lib/cdd/vault.rb', line 35

def export_url(format="csv")
  "/api/v1/vaults/#{self.id}/exports.#{format}"
end

#projectsObject



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

def projects
  @project ||= client.execute(projects_url).collect do |hash|
    CDD::Project.new(self.client, {:vault => self}.merge(hash))
  end
end

#projects_urlObject



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

def projects_url
  "/api/v1/vaults/#{self.id}/projects"
end

#searchesObject



25
26
27
28
29
# File 'lib/cdd/vault.rb', line 25

def searches
  @searches ||= client.execute(searches_url).collect do |hash|
    CDD::Search.new(client, {:vault => self}.merge(hash))
  end
end

#searches_urlObject



31
32
33
# File 'lib/cdd/vault.rb', line 31

def searches_url
  "/api/v1/vaults/#{self.id}/searches"
end