diff --git a/lib/veracode/api/builds.rb b/lib/veracode/api/builds.rb index 2254549..af956a1 100644 --- a/lib/veracode/api/builds.rb +++ b/lib/veracode/api/builds.rb @@ -77,18 +77,19 @@ def cots? end def builds - @builds ||= [] - if @builds.empty? - if @xml_hash.build.class == Array - @builds = @xml_hash.build.map do |build| - Build.new(build) + @builds ||= + if @xml_hash.include?('build') + if @xml_hash.build.class == Array + @builds = @xml_hash.build.map do |build| + Build.new(build) + end + else + @builds = [Build.new(@xml_hash.build)] + end + else + [] end - else - @builds << Build.new(@xml_hash.build) - end - end - return @builds - end + end end class Applications < Veracode::Common::Base