class IAuditor::Audit
Public Instance Methods
audit_export(audit, export, file)
click to toggle source
format. timezone, export_profile
# File lib/iAuditor/audit.rb, line 51 def audit_export(audit, export, file) @audits = self.class.get("/audits/#{audit}/exports/#{export}/#{file}", @options) end
audit_link(audit)
click to toggle source
Retrieving audit link
# File lib/iAuditor/audit.rb, line 20 def audit_link(audit) @audits = self.class.get("/audits/#{audit}/deep_link", @options) end
audit_media(audit,media)
click to toggle source
Retrieving audit media
# File lib/iAuditor/audit.rb, line 30 def audit_media(audit,media) @audits = self.class.get("/audits/#{audit}/media/#{media}", @options) end
audit_web_report_link(audit)
click to toggle source
Retrieving audit link
# File lib/iAuditor/audit.rb, line 25 def audit_web_report_link(audit) @audits = self.class.get("/audits/#{audit}/web_report_link", @options) end
export(audit, options={})
click to toggle source
# File lib/iAuditor/audit.rb, line 34 def export(audit, options={}) @audit_id = audit @options.merge!(query: options) if options.present? @export = self.class.post("/audits/#{@audit_id}/export", @options).parsed_response @status = export_polling_status return @status if @status["status"] == "FAILED" export_document end
fetch(audit)
click to toggle source
Retrieving audit detailed information
# File lib/iAuditor/audit.rb, line 14 def fetch(audit) @audit = self.class.get("/audits/#{audit}", @options) @audit.parsed_response end
search(options={})
click to toggle source
Retrieving all audits with the given search criteria
# File lib/iAuditor/audit.rb, line 7 def search(options={}) @options.merge!(query: options) if options.any? @audits = self.class.get("/audits/search", @options) @audits.parsed_response end
start_audit_export(audit,options={})
click to toggle source
format. timezone, export_profile
# File lib/iAuditor/audit.rb, line 45 def start_audit_export(audit,options={}) @options.merge!(query: options) if options.present? @audits = self.class.post("/audits/#{audit}/export", @options) end
Private Instance Methods
export_document()
click to toggle source
# File lib/iAuditor/audit.rb, line 63 def export_document file_name = URI.encode(@status["filename"]) self.class.get("/audits/#{@audit_id}/exports/#{@export["id"]}/#{file_name}", @options).parsed_response end
export_polling_status()
click to toggle source
# File lib/iAuditor/audit.rb, line 57 def export_polling_status @status = self.class.get("/audits/#{@audit_id}/exports/#{@export["id"]}", @options).parsed_response export_polling_status if @status["status"] == "IN PROGRESS" @status end