"""
cwe
===
"""
from CveXplore.common.data_source_connection import DatasourceConnection
[docs]class Cwe(DatasourceConnection):
"""
Cwe database object
"""
[docs] def __init__(self, **kwargs):
super().__init__("cwe")
for each in kwargs:
setattr(self, each, kwargs[each])
[docs] def to_dict(self):
"""
Method to convert the entire object to a dictionary
:return: Data from object
:rtype: dict
"""
return {k: v for (k, v) in self.__dict__.items() if not k.startswith("_")}
[docs] def __eq__(self, other):
return self.__dict__ == other.__dict__
[docs] def __ne__(self, other):
return self.__dict__ != other.__dict__
[docs] def __repr__(self):
""" String representation of object """
return "<< Cwe:{} >>".format(self.id)