Class: OSCRuby::QueryResultsSet

Inherits:
OpenStruct
  • Object
show all
Includes:
ValidationsModule
Defined in:
lib/osc_ruby/classes/query_results_set.rb

Instance Method Summary collapse

Methods included from ValidationsModule

attr_hash_exists_and_is_type_of, check_attributes, check_attributes_request, check_client, check_for_id, check_for_names, check_for_parents, check_interfaces, check_obj_for_errors, check_object_for_id, check_query, extract_attributes

Instance Method Details

#query_set(client, *args) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/osc_ruby/classes/query_results_set.rb', line 11

def query_set(client,*args)

  ValidationsModule::check_client(client)
  
  query_arr = []
  
  key_map = []

  args.each do |qh|

    key_map.push(qh[:key])

    query_arr.push(qh[:query])  
  
  end

  query_results_set = OpenStruct.new
  query_search = OSCRuby::QueryResults.new


  final_query_arr = query_arr.join('; ')
  final_results = query_search.query(client,final_query_arr)

  key_map.each_with_index {|k,i| query_results_set[k] = final_results[i]}
  query_results_set
end