class
   CycloneDX::BOM
 
  - CycloneDX::BOM
 - Reference
 - Object
 
Overview
Represents a CycloneDX Bill of Materials (BOM). This class manages a collection of components and provides methods for serializing the BOM into different formats (JSON, XML, CSV).
Included Modules
- JSON::Serializable
 
Defined in:
cyclonedx/bom.crConstructors
- 
        .new(components : Array(Component), spec_version : String)
        
          
Initializes a new CycloneDX BOM.
 - .new(pull : JSON::PullParser)
 
Instance Method Summary
- 
        #bom_format_json : String
        
          
Specifies the format of the BOM (always "CycloneDX" for JSON serialization).
 - 
        #bom_format_json=(bom_format_json : String)
        
          
Specifies the format of the BOM (always "CycloneDX" for JSON serialization).
 - 
        #components : Array(Component)
        
          
An array of
CycloneDX::Componentobjects included in the BOM. - 
        #components=(components : Array(Component))
        
          
An array of
CycloneDX::Componentobjects included in the BOM. - 
        #spec_version_json : String
        
          
The CycloneDX specification version used for JSON serialization.
 - 
        #spec_version_json=(spec_version_json : String)
        
          
The CycloneDX specification version used for JSON serialization.
 - 
        #to_csv
        
          
Serializes the BOM to CSV format.
 - 
        #to_xml
        
          
Serializes the BOM to XML format.
 - 
        #version_json : Int32
        
          
The version of the BOM itself (not the spec version), typically 1.
 - 
        #version_json=(version_json : Int32)
        
          
The version of the BOM itself (not the spec version), typically 1.
 
Constructor Detail
Initializes a new CycloneDX BOM.
@param components [Array(Component)] An array of components to include in the BOM. @param spec_version [String] The CycloneDX specification version (e.g., "1.4", "1.5").
Instance Method Detail
Specifies the format of the BOM (always "CycloneDX" for JSON serialization).
Specifies the format of the BOM (always "CycloneDX" for JSON serialization).
An array of CycloneDX::Component objects included in the BOM.
An array of CycloneDX::Component objects included in the BOM.
The CycloneDX specification version used for JSON serialization.
Serializes the BOM to CSV format. The CSV output includes Name, Version, PURL, and Type for each component.
@return [String] The BOM in CSV format.
Serializes the BOM to XML format. The XML output includes a unique serial number (UUID).
@return [String] The BOM in XML format.
The version of the BOM itself (not the spec version), typically 1.