def to_dict(asset):
    """Returns a dictionary representation of asset.

    This function is used to convert an 'asset' (aka a class implementing
    lakshmi.assets.Asset interface) into a dictionary. This is mainly used
    to serialize an asset type into a yaml-friendly format. The function
    lakshmi.assets.from_dict is an inverse of this function.

    Args:
        asset: An object of a class implementating lakshmi.assets.Asset
        interface.
    Returns: A dictionary representation of asset.
    """
    return {asset.__class__.__name__: asset.to_dict()}