Skip to main content

Tuple

Tuple class for Lua

Functions

new

Tuple.new(...any) → Tuple<T>

Constructs a new tuple

isTuple

Tuple.isTuple(valueany) → boolean

Returns true of the value is a tuple

Unpack

Tuple:Unpack() → T

Unpacks the tuple

ToArray

Tuple:ToArray() → {T}

Converts to array

__tostring

Tuple:__tostring() → ()

Converts the tuple to a string for easy debugging

__len

Tuple:__len() → number

Returns the length of the tuple

__eq

Tuple:__eq(otherTuple) → ()

Compares the tuple to another tuple

__add

Tuple:__add(otherTuple) → ()

Combines the tuple

Tuple()

Tuple() → ...

Unpacks the tuple

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new tuple",
            "params": [
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Tuple<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 17,
                "path": "src/tuple/src/Shared/Tuple.lua"
            }
        },
        {
            "name": "isTuple",
            "desc": "Returns true of the value is a tuple",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 27,
                "path": "src/tuple/src/Shared/Tuple.lua"
            }
        },
        {
            "name": "Unpack",
            "desc": "Unpacks the tuple",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 36,
                "path": "src/tuple/src/Shared/Tuple.lua"
            }
        },
        {
            "name": "ToArray",
            "desc": "Converts to array",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ T }"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 45,
                "path": "src/tuple/src/Shared/Tuple.lua"
            }
        },
        {
            "name": "__tostring",
            "desc": "Converts the tuple to a string for easy debugging",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 52,
                "path": "src/tuple/src/Shared/Tuple.lua"
            }
        },
        {
            "name": "__len",
            "desc": "Returns the length of the tuple",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 65,
                "path": "src/tuple/src/Shared/Tuple.lua"
            }
        },
        {
            "name": "__eq",
            "desc": "Compares the tuple to another tuple",
            "params": [
                {
                    "name": "other",
                    "desc": "",
                    "lua_type": "Tuple"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 73,
                "path": "src/tuple/src/Shared/Tuple.lua"
            }
        },
        {
            "name": "__add",
            "desc": "Combines the tuple",
            "params": [
                {
                    "name": "other",
                    "desc": "",
                    "lua_type": "Tuple"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 95,
                "path": "src/tuple/src/Shared/Tuple.lua"
            }
        },
        {
            "name": "__call",
            "desc": "Unpacks the tuple",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "..."
                }
            ],
            "function_type": "method",
            "source": {
                "line": 112,
                "path": "src/tuple/src/Shared/Tuple.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Tuple",
    "desc": "Tuple class for Lua",
    "source": {
        "line": 6,
        "path": "src/tuple/src/Shared/Tuple.lua"
    }
}