Class: CVEasy::Cve
- Inherits:
-
Object
- Object
- CVEasy::Cve
- Defined in:
- lib/CVEasy/cve.rb
Instance Method Summary collapse
- #assigned_at ⇒ Object
- #description ⇒ Object
-
#initialize(html) ⇒ Cve
constructor
A new instance of Cve.
- #name ⇒ Object
- #phase ⇒ Object
- #references ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(html) ⇒ Cve
Returns a new instance of Cve.
5 6 7 |
# File 'lib/CVEasy/cve.rb', line 5 def initialize(html) @html = html end |
Instance Method Details
#assigned_at ⇒ Object
35 36 37 |
# File 'lib/CVEasy/cve.rb', line 35 def assigned_at @assigned_at = @html.at_css('tr:nth-child(16) .note').inner_text.strip end |
#description ⇒ Object
13 14 15 |
# File 'lib/CVEasy/cve.rb', line 13 def description @description = @html.at_css('tr:nth-child(4)').inner_text.strip if @html.at_css('tr:nth-child(4)') end |
#name ⇒ Object
9 10 11 |
# File 'lib/CVEasy/cve.rb', line 9 def name @name = @html.at_css('h2').inner_text.strip if @html.at_css('h2') end |
#phase ⇒ Object
31 32 33 |
# File 'lib/CVEasy/cve.rb', line 31 def phase @phase = @html.at_css('tr:nth-child(11) td').inner_text end |
#references ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/CVEasy/cve.rb', line 17 def references unless @refs @refs = [] @html.css('li a').each do |link| @refs << ["#{link[:href]}"] end end @refs end |
#status ⇒ Object
27 28 29 |
# File 'lib/CVEasy/cve.rb', line 27 def status @status = @html.at_css('tr:nth-child(9) b').inner_text end |