Class: RaCve

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_acunetix/ra_cve.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, year, text) ⇒ RaCve

Returns a new instance of RaCve.



4
5
6
7
8
# File 'lib/ruby_acunetix/ra_cve.rb', line 4

def initialize(id, year, text)
  self.id = id
  self.year = year
  self.text = text
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



2
3
4
# File 'lib/ruby_acunetix/ra_cve.rb', line 2

def id
  @id
end

#textObject

Returns the value of attribute text.



2
3
4
# File 'lib/ruby_acunetix/ra_cve.rb', line 2

def text
  @text
end

#yearObject

Returns the value of attribute year.



2
3
4
# File 'lib/ruby_acunetix/ra_cve.rb', line 2

def year
  @year
end

Class Method Details

.parse(cve) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/ruby_acunetix/ra_cve.rb', line 11

def parse(cve)
  return nil if cve.css('CVE').nil? || cve.css('CVE').text.strip == ''

  id = cve.css('CVE').attribute('id').value
  year = cve.css('CVE').attribute('year').value
  text = cve.css('CVE').text
  
  RaCve.new(id, year, text)
end