Class: SemgrepWebApp::SbomOutputFormat
- Inherits:
-
Object
- Object
- SemgrepWebApp::SbomOutputFormat
- Defined in:
- lib/semgrep_web_app/models/sbom_output_format.rb
Overview
SBOM output format for the SBOM export. | value | description | |-------|---------------| | SBOM_OUTPUT_FORMAT_JSON | |
Constant Summary collapse
- SBOM_OUTPUT_FORMAT =
[ # TODO: Write general description for SBOM_OUTPUT_FORMAT_JSON SBOM_OUTPUT_FORMAT_JSON = 'SBOM_OUTPUT_FORMAT_JSON'.freeze, # TODO: Write general description for SBOM_OUTPUT_FORMAT_CYCLONEDX SBOM_OUTPUT_FORMAT_CYCLONEDX = 'SBOM_OUTPUT_FORMAT_CYCLONEDX'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = SBOM_OUTPUT_FORMAT_JSON) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/semgrep_web_app/models/sbom_output_format.rb', line 24 def self.from_value(value, default_value = SBOM_OUTPUT_FORMAT_JSON) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'sbom_output_format_json' then SBOM_OUTPUT_FORMAT_JSON when 'sbom_output_format_cyclonedx' then SBOM_OUTPUT_FORMAT_CYCLONEDX else default_value end end |
.validate(value) ⇒ Object
18 19 20 21 22 |
# File 'lib/semgrep_web_app/models/sbom_output_format.rb', line 18 def self.validate(value) return false if value.nil? SBOM_OUTPUT_FORMAT.include?(value) end |