Class ExtractorNumber
Subclass to do specialization of the extractor strategy class.
This spesialization do casting into a number type. This class follows the pattern with inheritance from Lua classes.
Metamethods
ExtractorNumber:__index (key) | Lookup of missing class members. |
Methods
ExtractorNumber:create (...) | Create a new instance. |
ExtractorNumber:_init () | Initialize a new instance. |
ExtractorNumber:cast (str) | Cast the string into the correct type for this strategy. |
ExtractorNumber:placeholder () | Get the placeholder for this strategy. |
Metamethods
- ExtractorNumber:__index (key)
-
Lookup of missing class members.
Parameters:
- key string lookup of member
Returns:
anyRaises:
on wrong arguments
Methods
- ExtractorNumber:create (...)
-
Create a new instance.
Parameters:
- ... vararg forwarded to superclass create method
Returns:
self - ExtractorNumber:_init ()
-
Initialize a new instance.
Returns:
self - ExtractorNumber:cast (str)
-
Cast the string into the correct type for this strategy.
There are no safeguards for erroneous casts.
Parameters:
- str string used as the extraction source
Returns:
numberRaises:
on wrong argumentsSee also:
- ExtractorNumber:placeholder ()
-
Get the placeholder for this strategy.
Returns:
string