Skip to content

Commit

Permalink
Add accessor for custom fields in applications
Browse files Browse the repository at this point in the history
  • Loading branch information
aogail committed Nov 25, 2019
1 parent b6d6a6d commit 4d40d62
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/veracode/api/builds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ def analysis_units
return @analysis_units
end
end


class CustomField < Veracode::Common::Base
api_field :name, :tag => :name
api_field :value, :tag => :value
end

class Application < Veracode::Common::Base
api_field :app_name, :tag => :app_name
api_field :app_id, :tag => :app_id
Expand All @@ -59,7 +64,14 @@ class Application < Veracode::Common::Base
api_field :modified_date, :tag => :modified_date
api_field :vendor, :tag => :vendor
api_field :tags, :tag => :tags


def custom_fields
@custom_fields ||=
@xml_hash.customfield.map do |customfield|
CustomField.new(customfield)
end
end

def cots?
@cots ||= @xml_hash.cots.to_bool
end
Expand Down

0 comments on commit 4d40d62

Please sign in to comment.