Class: RaCvss

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fields) ⇒ RaCvss

Returns a new instance of RaCvss.



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ruby_acunetix/ra_cvss.rb', line 4

def initialize(fields)
  self.descriptor = fields[:descriptor]
  self.score = fields[:score]
  self.av = fields[:av]
  self.ac = fields[:ac]
  self.au = fields[:au]
  self.c  = fields[:c]
  self.i  = fields[:i]
  self.a  = fields[:a]
  self.e  = fields[:e]
  self.rl = fields[:rl]
  self.rc = fields[:rc]
end

Instance Attribute Details

#aObject

Returns the value of attribute a.



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

def a
  @a
end

#acObject

Returns the value of attribute ac.



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

def ac
  @ac
end

#auObject

Returns the value of attribute au.



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

def au
  @au
end

#avObject

Returns the value of attribute av.



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

def av
  @av
end

#cObject

Returns the value of attribute c.



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

def c
  @c
end

#descriptorObject

Returns the value of attribute descriptor.



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

def descriptor
  @descriptor
end

#eObject

Returns the value of attribute e.



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

def e
  @e
end

#iObject

Returns the value of attribute i.



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

def i
  @i
end

#rcObject

Returns the value of attribute rc.



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

def rc
  @rc
end

#rlObject

Returns the value of attribute rl.



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

def rl
  @rl
end

#scoreObject

Returns the value of attribute score.



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

def score
  @score
end

Class Method Details

.parse(cvss) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/ruby_acunetix/ra_cvss.rb', line 19

def parse(cvss)
  fields = {}

  fields[:descriptor] = cvss.css(:Descriptor).text
  fields[:score] = cvss.css(:Score).text
  fields[:av] = cvss.css(:AV).text
  fields[:ac] = cvss.css(:AC).text
  fields[:au] = cvss.css(:Au).text
  fields[:c]  = cvss.css(:C).text
  fields[:i]  = cvss.css(:I).text
  fields[:a]  = cvss.css(:A).text
  fields[:e]  = cvss.css(:E).text
  fields[:rl] = cvss.css(:RL).text
  fields[:rc] = cvss.css(:RC).text
  
  RaCvss.new(fields)
end