Skip to content
github-actions[bot] edited this page Nov 23, 2024 · 3 revisions

Glu

Glu.get_glass

Get a glass by name.

Parameters

  • glass_name (string) - The name of the glass to retrieve.

Returns

Glass? - The glass, or nil if it does not exist.

Examples

local glass = Glu.get_glass("MyGlass")

Glu.get_glass_names

Get all glass names.

Returns

string[] - A table of glass names.

Examples

local glass_names = Glu.get_glass_names()

Glu.get_glasses

Get all glasses.

Returns

Glass[] - A table of glasses.

Examples

local glasses = Glu.get_glasses()

Glu.get_last_traceback_line

Get the last traceback line. Used for validation functions, or any time you need to get the last line of a traceback. Also available via the v table from the anchor.

Returns

string - The last traceback line.

Glu.has_glass

Check if a glass exists.

Parameters

  • glass_name (string) - The name of the glass to check for.

Returns

boolean - True if the glass exists, false otherwise.

Examples

local exists = Glu.has_glass("MyGlass")

Glu.id

Generate a unique identifier, producing a version 4 UUID.

Returns

string - A unique identifier.

Examples

local id = Glu.id()

Glu.new

Instantiate a new Glu instance. Can be invoked by its class name or by the new function.

Parameters

  • package_name (string) - The name of the package to which this module belongs.
  • module_dir_name (string?) - The directory name inside the package directory where the modules are located.

Returns

Glu - A new Glu instance.

Examples

local glu = Glu.new("MyPackage", "MyModule")
local glu = Glu("MyPackage", "MyModule")
Clone this wiki locally