Class: Veracode::Result::Category

Inherits:
Common::Base show all
Defined in:
lib/veracode/api/detailed.rb

Instance Method Summary collapse

Methods inherited from Common::Base

api_field, api_type_field, #initialize

Constructor Details

This class inherits a constructor from Veracode::Common::Base

Instance Method Details

#cweObject



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/veracode/api/detailed.rb', line 68

def cwe
  @cwe ||= [] 
  begin
    if @cwe.empty?
      if @xml_hash.cwe.class == Array 
        @cwe = @xml_hash.cwe.map do |c|
          CWE.new(c)
        end
      else
        @cwe << CWE.new(@xml_hash.cwe) 
      end
    end
  rescue NoMethodError
  end
  
  return @cwe
end

#descriptionObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/veracode/api/detailed.rb', line 34

def description
  temp = self.desc.para.map do |para|
    para.text
  end       
  
  self.desc.para.map do |para|
    if !para.bulletitem.nil?
      x = para.bulletitem.each.map do |item|
        "* " + item.text + "\r\n"
      end
    end
    temp << x.join
  end 
  
  return temp.join("\r\n\r\n").strip
end

#pcirelated?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/veracode/api/detailed.rb', line 30

def pcirelated?
  @pcirelated ||= @xml_hash.pcirelated.to_bool
end

#recommendationObject



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/veracode/api/detailed.rb', line 51

def recommendation
  temp = self.recommendations.para.map do |para|
    para.text
  end       
  
  self.recommendations.para.map do |para|
    if !para.bulletitem.nil?
      x = para.bulletitem.each.map do |item|
        "* " + item.text + "\r\n"
      end
    end
    temp << x.join
  end 
  
  return temp.join("\r\n\r\n").strip
end