class Glue::Finding

Attributes

appname[R]
description[R]
detail[R]
fingerprint[R]
severity[R]
source[R]
timestamp[R]

Public Class Methods

new(appname, description, detail, source, severity, fingerprint) click to toggle source
# File lib/glue/finding.rb, line 12
def initialize appname, description, detail, source, severity, fingerprint
      @appname = appname
      @timestamp = Time.now
      @description = description
      @detail = detail
      @source = source
      @stringsrc = source.to_s
      @severity = severity
      @fingerprint = fingerprint
end

Public Instance Methods

to_csv() click to toggle source
# File lib/glue/finding.rb, line 34
def to_csv
  s = "#{@appname},#{@description},#{@timestamp},#{@source.to_s},#{@severity},#{@fingerprint},#{@detail}\n"
  s
end
to_json() click to toggle source
# File lib/glue/finding.rb, line 39
def to_json
  json = {
   'appname' => @appname,
   'description' => @description,
   'fingerprint' => @fingerprint,
   'detail' => @detail,
   'source' => @source,
   'severity' => @severity,
   'timestamp' => @timestamp
  }.to_json
  json
end
to_string() click to toggle source
# File lib/glue/finding.rb, line 23
def to_string
      s = "Finding: #{@appname}"
      s << "\n\tDescription: #{@description}"
      s << "\n\tTimestamp: #{@timestamp}"
      s << "\n\tSource: #{@stringsrc}"
      s << "\n\tSeverity: #{@severity}"
      s << "\n\tFingerprint:  #{@fingerprint}"
      s << "\n\tDetail:  #{@detail}"
      s
end