class
   CycloneDX::Component
 
  - CycloneDX::Component
 - Reference
 - Object
 
Overview
Represents a component in the CycloneDX Bill of Materials (BOM). This class is responsible for defining the structure and serialization of a software component, including its type, name, version, and PURL.
Included Modules
- JSON::Serializable
 
Defined in:
cyclonedx/component.crConstructors
- 
        .new(name : String, version : String, component_type : String = "library", purl : Nil | String = nil)
        
          
Initializes a new CycloneDX Component.
 - .new(pull : JSON::PullParser)
 
Instance Method Summary
- 
        #component_type : String
        
          
The type of the component (e.g., "library", "application").
 - 
        #component_type=(component_type : String)
        
          
The type of the component (e.g., "library", "application").
 - 
        #name : String
        
          
The name of the component.
 - 
        #name=(name : String)
        
          
The name of the component.
 - 
        #purl : String | Nil
        
          
The Package URL (PURL) of the component, if available.
 - 
        #purl=(purl : String | Nil)
        
          
The Package URL (PURL) of the component, if available.
 - 
        #to_xml(builder : XML::Builder)
        
          
Serializes the component to XML format.
 - 
        #version : String
        
          
The version of the component.
 - 
        #version=(version : String)
        
          
The version of the component.
 
Constructor Detail
Initializes a new CycloneDX Component.
@param name [String] The name of the component. @param version [String] The version of the component. @param component_type [String] The type of the component (default: "library"). @param purl [String?] The PURL of the component (default: nil).
Instance Method Detail
The type of the component (e.g., "library", "application").
Serializes the component to XML format.
@param builder [XML::Builder] The XML builder instance.