Class: CVEasy::Cve

Inherits:
Object
  • Object
show all
Defined in:
lib/CVEasy/cve.rb

Instance Method Summary collapse

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_atObject



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

#descriptionObject



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

#nameObject



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

#phaseObject



31
32
33
# File 'lib/CVEasy/cve.rb', line 31

def phase
  @phase = @html.at_css('tr:nth-child(11) td').inner_text
end

#referencesObject



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

#statusObject



27
28
29
# File 'lib/CVEasy/cve.rb', line 27

def status
  @status = @html.at_css('tr:nth-child(9) b').inner_text
end