class OSvCRuby::QueryResults

Public Class Methods

new() click to toggle source
# File lib/osvc_ruby/classes/query_results.rb, line 12
def initialize; end

Public Instance Methods

query(client,query) click to toggle source
# 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