Class Support.Bool

The Bool support class contains helper functions to manipulate boolean values.

Usage:

    -- library is an instance of the Stormwind Library
    library.bool
    

Methods

support.bool:isTrue (value) Determines whether a value represents true or not.


Methods

support.bool:isTrue (value)
Determines whether a value represents true or not.

This method checks if a value is in a range of possible values that represent a true value.

Parameters:

  • value integer, string or boolean the value to be checked

Returns:

    boolean whether the value represents a true value or not

Usage:

    -- library is an instance of the Stormwind Library
    library.bool:isTrue("yes") -- true
    library.bool:isTrue("no")  -- false
    library.bool:isTrue("1")   -- true
    library.bool:isTrue("0")   -- false
    library.bool:isTrue(1)     -- true
    library.bool:isTrue(0)     -- false
    library.bool:isTrue(true)  -- true
    library.bool:isTrue(false) -- false
generated by LDoc 1.5.0 Last updated 2024-09-11 16:27:53