Class: Vulnerability
- Inherits:
-
Object
- Object
- Vulnerability
- Defined in:
- lib/domain/vulnerability/model.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#published ⇒ Object
Returns the value of attribute published.
-
#risk_score ⇒ Object
Returns the value of attribute risk_score.
-
#severity ⇒ Object
Returns the value of attribute severity.
-
#severity_score ⇒ Object
Returns the value of attribute severity_score.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
-
.from_json(data) ⇒ Object
data json comes from the API vulnerabilities/get.
Instance Method Summary collapse
-
#initialize(id:, title:, description:, published:, risk_score:, severity:, severity_score:) ⇒ Vulnerability
constructor
A new instance of Vulnerability.
- #to_s ⇒ Object
Constructor Details
#initialize(id:, title:, description:, published:, risk_score:, severity:, severity_score:) ⇒ Vulnerability
Returns a new instance of Vulnerability.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/domain/vulnerability/model.rb', line 14 def initialize( id:, title:, description:, published:, risk_score:, severity:, severity_score: ) @id = id @title = title @description = description @published = published @risk_score = risk_score @severity = severity @severity_score = severity_score end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/domain/vulnerability/model.rb', line 6 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/domain/vulnerability/model.rb', line 6 def id @id end |
#published ⇒ Object
Returns the value of attribute published.
6 7 8 |
# File 'lib/domain/vulnerability/model.rb', line 6 def published @published end |
#risk_score ⇒ Object
Returns the value of attribute risk_score.
6 7 8 |
# File 'lib/domain/vulnerability/model.rb', line 6 def risk_score @risk_score end |
#severity ⇒ Object
Returns the value of attribute severity.
6 7 8 |
# File 'lib/domain/vulnerability/model.rb', line 6 def severity @severity end |
#severity_score ⇒ Object
Returns the value of attribute severity_score.
6 7 8 |
# File 'lib/domain/vulnerability/model.rb', line 6 def severity_score @severity_score end |
#title ⇒ Object
Returns the value of attribute title.
6 7 8 |
# File 'lib/domain/vulnerability/model.rb', line 6 def title @title end |
Class Method Details
.from_json(data) ⇒ Object
data json comes from the API vulnerabilities/get
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/domain/vulnerability/model.rb', line 33 def self.from_json(data) Vulnerability.new( id: data[:id], title: data[:title], description: data[:description], published: data[:published], risk_score: data[:riskScore], severity: data[:severity], severity_score: data[:severityScore] ) end |
Instance Method Details
#to_s ⇒ Object
45 46 47 |
# File 'lib/domain/vulnerability/model.rb', line 45 def to_s [id, title, description, severity, published].join ',' end |