Class: Veracode::Common::Base
- Inherits:
-
Object
- Object
- Veracode::Common::Base
- Defined in:
- lib/veracode/api/types.rb
Overview
Base Class for result
Direct Known Subclasses
Result::Analysis, Result::AnnotationType, Result::Annotations, Result::AppendixType, Result::Builds::AnalysisUnit, Result::Builds::Application, Result::Builds::Applications, Result::Builds::Build, Result::Builds::CustomField, Result::BulletType, Result::CWE, Result::Call, Result::CallStack, Result::CallStacks, Result::Category, Result::DetailedReport, Result::ExploitAdjustment, Result::ExploitabilityAdjustment, Result::Flaw, Result::FlawStatus, Result::Flaws, Result::ManualAnalysis, Result::MitigationType, Result::Mitigations, Result::MitigiationInfo, Result::Module, Result::Para, Result::ParaType, Result::Screenshot, Result::Severity, Result::SummaryCategory, Result::SummaryReport, Result::SummarySeverity, Result::TextType, Upload::AnalysisUnit, Upload::App, Upload::AppList, Upload::Application, Upload::ApplicationInfo, Upload::Build, Upload::BuildInfo, Upload::BuildList
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(xml_hash) ⇒ Base
constructor
Takes Hash of XML stores, hash is has addition to allow dot access to components.
Constructor Details
#initialize(xml_hash) ⇒ Base
Takes Hash of XML stores, hash is has addition to allow dot access to components
34 35 36 |
# File 'lib/veracode/api/types.rb', line 34 def initialize(xml_hash) @xml_hash = xml_hash end |
Class Method Details
.api_field(name, args) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/veracode/api/types.rb', line 11 def self.api_field(name, args) send(:define_method, name) do begin return @xml_hash.send(args[:tag].to_sym) rescue NoMethodError return nil end end end |
.api_type_field(name, args) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/veracode/api/types.rb', line 21 def self.api_type_field(name, args) send(:define_method, name) do begin tmp = eval("@" + name.to_s) tmp ||= args[:as].new(@xml_hash.send(args[:tag].to_sym)) instance_variable_set("@#{name}", tmp) return tmp rescue NoMethodError return nil end end end |