Class: Veracode::Result::Flaws

Inherits:
Common::Base show all
Defined in:
lib/veracode/api/flaws.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

#flawsObject



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/veracode/api/flaws.rb', line 134

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