Class: GemGuard::Vulnerability

Inherits:
Object
  • Object
show all
Defined in:
lib/gem_guard/vulnerability_fetcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, gem_name:, affected_versions: [], fixed_versions: [], severity: "UNKNOWN", summary: "", details: "") ⇒ Vulnerability

Returns a new instance of Vulnerability.



244
245
246
247
248
249
250
251
252
# File 'lib/gem_guard/vulnerability_fetcher.rb', line 244

def initialize(id:, gem_name:, affected_versions: [], fixed_versions: [], severity: "UNKNOWN", summary: "", details: "")
  @id = id
  @gem_name = gem_name
  @affected_versions = affected_versions
  @fixed_versions = fixed_versions
  @severity = severity
  @summary = summary
  @details = details
end

Instance Attribute Details

#affected_versionsObject (readonly)

Returns the value of attribute affected_versions.



242
243
244
# File 'lib/gem_guard/vulnerability_fetcher.rb', line 242

def affected_versions
  @affected_versions
end

#detailsObject (readonly)

Returns the value of attribute details.



242
243
244
# File 'lib/gem_guard/vulnerability_fetcher.rb', line 242

def details
  @details
end

#fixed_versionsObject (readonly)

Returns the value of attribute fixed_versions.



242
243
244
# File 'lib/gem_guard/vulnerability_fetcher.rb', line 242

def fixed_versions
  @fixed_versions
end

#gem_nameObject (readonly)

Returns the value of attribute gem_name.



242
243
244
# File 'lib/gem_guard/vulnerability_fetcher.rb', line 242

def gem_name
  @gem_name
end

#idObject (readonly)

Returns the value of attribute id.



242
243
244
# File 'lib/gem_guard/vulnerability_fetcher.rb', line 242

def id
  @id
end

#severityObject (readonly)

Returns the value of attribute severity.



242
243
244
# File 'lib/gem_guard/vulnerability_fetcher.rb', line 242

def severity
  @severity
end

#summaryObject (readonly)

Returns the value of attribute summary.



242
243
244
# File 'lib/gem_guard/vulnerability_fetcher.rb', line 242

def summary
  @summary
end

Instance Method Details

#==(other) ⇒ Object



254
255
256
# File 'lib/gem_guard/vulnerability_fetcher.rb', line 254

def ==(other)
  other.is_a?(Vulnerability) && id == other.id
end