Class: Gitlab::Ci::Reports::Sbom::Source
- Inherits:
-
Object
- Object
- Gitlab::Ci::Reports::Sbom::Source
- Defined in:
- lib/gitlab/ci/reports/sbom/source.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#source_type ⇒ Object
readonly
Returns the value of attribute source_type.
Instance Method Summary collapse
-
#initialize(type:, data:) ⇒ Source
constructor
A new instance of Source.
- #input_file_path ⇒ Object
- #language ⇒ Object
- #packager ⇒ Object
- #source_file_path ⇒ Object
Constructor Details
#initialize(type:, data:) ⇒ Source
Returns a new instance of Source.
10 11 12 13 |
# File 'lib/gitlab/ci/reports/sbom/source.rb', line 10 def initialize(type:, data:) @source_type = type @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'lib/gitlab/ci/reports/sbom/source.rb', line 8 def data @data end |
#source_type ⇒ Object (readonly)
Returns the value of attribute source_type.
8 9 10 |
# File 'lib/gitlab/ci/reports/sbom/source.rb', line 8 def source_type @source_type end |
Instance Method Details
#input_file_path ⇒ Object
19 20 21 |
# File 'lib/gitlab/ci/reports/sbom/source.rb', line 19 def input_file_path data.dig('input_file', 'path') end |
#language ⇒ Object
27 28 29 |
# File 'lib/gitlab/ci/reports/sbom/source.rb', line 27 def language data.dig('language', 'name') end |
#packager ⇒ Object
23 24 25 |
# File 'lib/gitlab/ci/reports/sbom/source.rb', line 23 def packager data.dig('package_manager', 'name') end |
#source_file_path ⇒ Object
15 16 17 |
# File 'lib/gitlab/ci/reports/sbom/source.rb', line 15 def source_file_path data.dig('source_file', 'path') end |