Class: Veracode::Result::Annotations

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

#annotationObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/veracode/api/flaws.rb', line 13

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