Class: Gitlab::Ci::Reports::Sbom::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/ci/reports/sbom/source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (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_typeObject (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_pathObject



19
20
21
# File 'lib/gitlab/ci/reports/sbom/source.rb', line 19

def input_file_path
  data.dig('input_file', 'path')
end

#languageObject



27
28
29
# File 'lib/gitlab/ci/reports/sbom/source.rb', line 27

def language
  data.dig('language', 'name')
end

#packagerObject



23
24
25
# File 'lib/gitlab/ci/reports/sbom/source.rb', line 23

def packager
  data.dig('package_manager', 'name')
end

#source_file_pathObject



15
16
17
# File 'lib/gitlab/ci/reports/sbom/source.rb', line 15

def source_file_path
  data.dig('source_file', 'path')
end