Class: OSvCRuby::QueryResults
- Inherits:
 - 
      Object
      
        
- Object
 - OSvCRuby::QueryResults
 
 
- Includes:
 - NormalizeModule, ValidationsModule
 
- Defined in:
 - lib/osvc_ruby/classes/query_results.rb
 
Instance Method Summary collapse
- 
  
    
      #initialize  ⇒ QueryResults 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of QueryResults.
 - #query(client, query) ⇒ Object
 
Methods included from ValidationsModule
Methods included from NormalizeModule
iterate_through_rows, normalize
Constructor Details
#initialize ⇒ QueryResults
Returns a new instance of QueryResults.
      12  | 
    
      # File 'lib/osvc_ruby/classes/query_results.rb', line 12 def initialize; end  | 
  
Instance Method Details
#query(client, query) ⇒ Object
      14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35  | 
    
      # File 'lib/osvc_ruby/classes/query_results.rb', line 14 def query(client,query) ValidationsModule::check_client(client) ValidationsModule::check_query(query,"query") @query = URI.escape("queryResults/?query=#{query}") obj_to_find = OSvCRuby::Connect.get(client,@query) if obj_to_find.code.to_i == 200 || obj_to_find.code.to_i == 201 response = NormalizeModule::normalize(obj_to_find) else response = obj_to_find.body end JSON.parse(response) end  |