class documentation

Default implementation of TokenVersionExtractor using predefined versions.

This extractor checks if the token starts with any of the predefined prefixes and returns the matching TokenVersion.

Parameters
versionsDictionary of token versions to use for extraction.
Method __init__ Undocumented
Method extract Extract the token version by matching prefixes.
Instance Variable versions Dictionary of available token versions.
def __init__(self, versions: dict[str, TokenVersion]): (source)

Undocumented

def extract(self, token: str) -> tuple[TokenVersion, bool]: (source)

Extract the token version by matching prefixes.

Parameters
token:strThe token string to analyze.
Returns
tuple[TokenVersion, bool]The matching TokenVersion and True if recognized, otherwise a default TokenVersion and False.

Dictionary of available token versions.