Class: CtdDocumentation::SlimInsight
- Defined in:
- lib/ctd_documentation/models/slim_insight.rb
Overview
SlimInsight Model.
Instance Attribute Summary collapse
-
#comment ⇒ String
Last comment provided by user.
-
#cve_id ⇒ String
The CVE’s ID.
-
#cvss ⇒ Object
The CVE’s score.
-
#identified_on ⇒ String
The timestamp when the CVE was identified.
-
#last_updated ⇒ String
The timestamp when the latest change on the CVE was made in the EMC.
-
#modified ⇒ String
The full date of the latest modification was made on the CVE by the global provider.
-
#published ⇒ String
The full date when the CVE’s was published at.
-
#status ⇒ Integer
A number that represents the CVE’s status.
-
#title ⇒ String
The CVE’s title.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(comment = SKIP, cve_id = SKIP, cvss = SKIP, identified_on = SKIP, last_updated = SKIP, modified = SKIP, published = SKIP, status = SKIP, title = SKIP) ⇒ SlimInsight
constructor
A new instance of SlimInsight.
Methods inherited from BaseModel
Constructor Details
#initialize(comment = SKIP, cve_id = SKIP, cvss = SKIP, identified_on = SKIP, last_updated = SKIP, modified = SKIP, published = SKIP, status = SKIP, title = SKIP) ⇒ SlimInsight
Returns a new instance of SlimInsight.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 92 def initialize(comment = SKIP, cve_id = SKIP, cvss = SKIP, identified_on = SKIP, last_updated = SKIP, modified = SKIP, published = SKIP, status = SKIP, title = SKIP) @comment = comment unless comment == SKIP @cve_id = cve_id unless cve_id == SKIP @cvss = cvss unless cvss == SKIP @identified_on = identified_on unless identified_on == SKIP @last_updated = last_updated unless last_updated == SKIP @modified = modified unless modified == SKIP @published = published unless published == SKIP @status = status unless status == SKIP @title = title unless title == SKIP end |
Instance Attribute Details
#comment ⇒ String
Last comment provided by user
14 15 16 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 14 def comment @comment end |
#cve_id ⇒ String
The CVE’s ID
18 19 20 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 18 def cve_id @cve_id end |
#cvss ⇒ Object
The CVE’s score
22 23 24 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 22 def cvss @cvss end |
#identified_on ⇒ String
The timestamp when the CVE was identified. Format: YYYY-MM-DDTHH:MM:SS (in UTC)
27 28 29 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 27 def identified_on @identified_on end |
#last_updated ⇒ String
The timestamp when the latest change on the CVE was made in the EMC. Format: YYYY-MM-DDTHH:MM:SS+00:00 (in UTC)
32 33 34 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 32 def last_updated @last_updated end |
#modified ⇒ String
The full date of the latest modification was made on the CVE by the global provider. Format: YYYY-MM-DD
38 39 40 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 38 def modified @modified end |
#published ⇒ String
The full date when the CVE’s was published at. Format: YYYY-MM-DD
43 44 45 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 43 def published @published end |
#status ⇒ Integer
A number that represents the CVE’s status. Options: 0 - Open 1 - Hidden 2 - Completed
51 52 53 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 51 def status @status end |
#title ⇒ String
The CVE’s title
55 56 57 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 55 def title @title end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 113 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. comment = hash.key?('comment') ? hash['comment'] : SKIP cve_id = hash.key?('cve_id') ? hash['cve_id'] : SKIP cvss = Object.from_hash(hash['cvss']) if hash['cvss'] identified_on = hash.key?('identified_on') ? hash['identified_on'] : SKIP last_updated = hash.key?('last_updated') ? hash['last_updated'] : SKIP modified = hash.key?('modified') ? hash['modified'] : SKIP published = hash.key?('published') ? hash['published'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP title = hash.key?('title') ? hash['title'] : SKIP # Create object from extracted values. SlimInsight.new(comment, cve_id, cvss, identified_on, last_updated, modified, published, status, title) end |
.names ⇒ Object
A mapping from model property names to API property names.
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 58 def self.names @_hash = {} if @_hash.nil? @_hash['comment'] = 'comment' @_hash['cve_id'] = 'cve_id' @_hash['cvss'] = 'cvss' @_hash['identified_on'] = 'identified_on' @_hash['last_updated'] = 'last_updated' @_hash['modified'] = 'modified' @_hash['published'] = 'published' @_hash['status'] = 'status' @_hash['title'] = 'title' @_hash end |
.nullables ⇒ Object
An array for nullable fields
88 89 90 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 88 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/ctd_documentation/models/slim_insight.rb', line 73 def self.optionals %w[ comment cve_id cvss identified_on last_updated modified published status title ] end |