Class Translators
Class for extractor strategies.
This class follows the pattern from Lua classes.
Metamethods
Translators:__index (key) | Lookup of missing class members. |
Methods
Translators:create (...) | Create a new instance. |
Translators:_init (...) | Initialize a new instance. |
Translators:register (key, strategy) | Register a new strategy. |
Translators:flush () | Removes all registered translators. |
Translators:find (key) | Find a matching extractor. |
Metamethods
- Translators:__index (key)
-
Lookup of missing class members.
Parameters:
- key string lookup of member
Returns:
anyRaises:
on wrong arguments
Methods
- Translators:create (...)
-
Create a new instance.
Parameters:
- ... vararg list of strategies
Returns:
self - Translators:_init (...)
-
Initialize a new instance.
Parameters:
- ... vararg list of packaged strategies
Returns:
self - Translators:register (key, strategy)
-
Register a new strategy.
Parameters:
- key string lookup of translator
- strategy Translator to be registered
Returns:
self - Translators:flush ()
-
Removes all registered translators.
Returns:
self - Translators:find (key)
-
Find a matching extractor.
Parameters:
- key string lookup of translator
Returns:
Translator,number,number strategy,first,lastRaises:
On missing source