class CVEList::MalformedCVE

Represents malformed/invalid CVE JSON that could not be loaded.

Attributes

exception[R]

The exception encountered when parsing the JSON file.

@return [StandardError]

path[R]

Path to the JSON file.

@return [String]

Public Class Methods

new(path,exception) click to toggle source

Initializes the malformed json.

@param [String] path

Path to the JSON file.

@param [StandardError] exception

The exception encountered when parsing the JSON file.
# File lib/cvelist/malformed_cve.rb, line 26
def initialize(path,exception)
  @path      = path
  @exception = exception
end

Public Instance Methods

to_s() click to toggle source

Converts the malformed JSON back into a String.

@return [String]

The String containing the {#path}, the {#exception} class and message.
# File lib/cvelist/malformed_cve.rb, line 37
def to_s
  "#{@path}: #{@exception.class}: #{@exception.message}"
end