Class Extractors
Baseclass for extractor strategies.
This class follows the pattern from Lua classes.
Metamethods
Extractors:__index (key) | Lookup of missing class members. |
Methods
Extractors:create (...) | Create a new instance. |
Extractors:_init (...) | Initialize a new instance. |
Extractors:register (strategy) | Register a new strategy. |
Extractors:flush () | Removes all registered extractors. |
Extractors:num () | The number of registered extractors. |
Extractors:find (str[, pos=1]) | Find a matching extractor. |
Metamethods
- Extractors:__index (key)
-
Lookup of missing class members.
Parameters:
- key string lookup of member
Returns:
anyRaises:
on wrong arguments
Methods
- Extractors:create (...)
-
Create a new instance.
Parameters:
- ... vararg forwarded to Extractor:_init
Returns:
self - Extractors:_init (...)
-
Initialize a new instance.
Parameters:
- ... vararg list of strategies
Returns:
self - Extractors:register (strategy)
-
Register a new strategy.
Parameters:
- strategy to be registered
Returns:
selfRaises:
on wrong arguments - Extractors:flush ()
-
Removes all registered extractors.
Returns:
self - Extractors:num ()
-
The number of registered extractors.
Returns:
number - Extractors:find (str[, pos=1])
-
Find a matching extractor.
Parameters:
- str string used as the extraction source
- pos nil or number for an inclusive index where extraction starts (default 1)
Returns:
strategy,first,lastRaises:
on wrong arguments