Class: Tigre::Analysis

Inherits:
Object
  • Object
show all
Extended by:
CommonGetters, CommonParams
Defined in:
lib/tigre-client/analysis.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from CommonParams

before_after, before_after_page_per, common_params, get_klass, get_logic_param, package_array_list, page_per

Methods included from CommonGetters

count, index

Class Method Details

.add_file(analysis_id, file_location, file_type) ⇒ Object

required

analysis_id => String
file_location => String path to the file
file_type => String, the type of the file


42
43
44
45
46
47
48
49
# File 'lib/tigre-client/analysis.rb', line 42

def self.add_file(analysis_id, file_location, file_type)
  if analysis_id == '' || file_location.empty? || file_type.empty?
    raise "Missing analysis_id, file_location, or file_type parameter"
  end
  
  update_data = {:file => File.new(file_location), :file_type => file_type}
  Tigre.put_connection("/analyses/#{analysis_id}/upload", update_data)
end

.update(analysis_id, params_hash) ⇒ Object

required

analysis_id => String
params_hash => Hash
  :dbts => Hash {:key1 => value, :key2 => value} where the key is what the name of the 
           attribute is and the value should be a boolean
  :mutex_name_list => String (comma seperated) => I.E 'foo,bar,baz'
  :mutex_name_list => Array => ['foo', 'bar', 'baz']


24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/tigre-client/analysis.rb', line 24

def self.update(analysis_id, params_hash)
  if analysis_id == '' || params_hash.empty?
    raise "Missing analysis_id parameter or params_hash is empty"
  end
  
  if params_hash[:mutex_name_list]
    params_hash[:mutex_name_list] = package_array_list(params_hash[:mutex_name_list])
  end
  
  update_data = {:metadatas => params_hash}
  
  Tigre.put_connection("/analyses/#{analysis_id}", update_data)
end

Instance Method Details

#get(analysis_id) ⇒ Object

required

analysis_id => String


9
10
11
12
13
14
15
# File 'lib/tigre-client/analysis.rb', line 9

def get(analysis_id)
  if analysis_id == '' 
    raise "Missing analysis_id parameter"
  end
  
  Tigre.get_connection("analyses/#{analysis_id}")
end