Class: CycloneDX::CocoaPods::BOMBuilder
- Inherits:
-
Object
- Object
- CycloneDX::CocoaPods::BOMBuilder
- Defined in:
- lib/cyclonedx/cocoapods/bom_builder.rb
Overview
Turns the internal model data into an XML bom.
Constant Summary collapse
- NAMESPACE =
'http://cyclonedx.org/schema/bom/1.6'
Instance Attribute Summary collapse
-
#component ⇒ Object
readonly
Returns the value of attribute component.
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#manifest_path ⇒ Object
readonly
Returns the value of attribute manifest_path.
-
#manufacturer ⇒ Object
readonly
Returns the value of attribute manufacturer.
-
#pods ⇒ Object
readonly
Returns the value of attribute pods.
Instance Method Summary collapse
- #bom(version: 1, trim_strings_length: 0, format: :xml) ⇒ Object
-
#initialize(pods:, manifest_path:, component: nil, dependencies: nil, manufacturer: nil) ⇒ BOMBuilder
constructor
A new instance of BOMBuilder.
Constructor Details
#initialize(pods:, manifest_path:, component: nil, dependencies: nil, manufacturer: nil) ⇒ BOMBuilder
Returns a new instance of BOMBuilder.
344 345 346 347 348 349 350 |
# File 'lib/cyclonedx/cocoapods/bom_builder.rb', line 344 def initialize(pods:, manifest_path:, component: nil, dependencies: nil, manufacturer: nil) @pods = pods.sort_by(&:purl) @manifest_path = manifest_path @component = component @dependencies = dependencies&.sort @manufacturer = manufacturer end |
Instance Attribute Details
#component ⇒ Object (readonly)
Returns the value of attribute component.
342 343 344 |
# File 'lib/cyclonedx/cocoapods/bom_builder.rb', line 342 def component @component end |
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
342 343 344 |
# File 'lib/cyclonedx/cocoapods/bom_builder.rb', line 342 def dependencies @dependencies end |
#manifest_path ⇒ Object (readonly)
Returns the value of attribute manifest_path.
342 343 344 |
# File 'lib/cyclonedx/cocoapods/bom_builder.rb', line 342 def manifest_path @manifest_path end |
#manufacturer ⇒ Object (readonly)
Returns the value of attribute manufacturer.
342 343 344 |
# File 'lib/cyclonedx/cocoapods/bom_builder.rb', line 342 def manufacturer @manufacturer end |
#pods ⇒ Object (readonly)
Returns the value of attribute pods.
342 343 344 |
# File 'lib/cyclonedx/cocoapods/bom_builder.rb', line 342 def pods @pods end |
Instance Method Details
#bom(version: 1, trim_strings_length: 0, format: :xml) ⇒ Object
352 353 354 355 356 357 358 |
# File 'lib/cyclonedx/cocoapods/bom_builder.rb', line 352 def bom(version: 1, trim_strings_length: 0, format: :xml) validate_version(version) validate_trim_length(trim_strings_length) validate_format(format) unchecked_bom(version: version, trim_strings_length: trim_strings_length, format: format) end |