Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:LibraryUtil

From CM-SS13 - Wiki
Revision as of 08:20, 9 September 2023 by Harryob (talk | contribs) (Created page with "-- Imported from: https://runescape.wiki/w/Module:LibraryUtil -- <nowiki> local libraryUtil = require( 'libraryUtil' ) function libraryUtil.makeCheckClassFunction( libraryName, varName, class, selfObjDesc ) return function ( self, method ) if getmetatable( self ) ~= class then error( string.format( "%s: invalid %s. Did you call %s with a dot instead of a colon, i.e. " .. "%s.%s() instead of %s:%s()?", libraryName, selfObjDesc, method, varName, method,...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:LibraryUtil/doc

-- Imported from: https://runescape.wiki/w/Module:LibraryUtil

-- <nowiki>
local libraryUtil = require( 'libraryUtil' )

function libraryUtil.makeCheckClassFunction( libraryName, varName, class, selfObjDesc )
	return function ( self, method )
		if getmetatable( self ) ~= class then
			error( string.format(
				"%s: invalid %s. Did you call %s with a dot instead of a colon, i.e. " ..
				"%s.%s() instead of %s:%s()?",
				libraryName, selfObjDesc, method, varName, method, varName, method
			), 3 )
		end
	end
end

return libraryUtil
-- </nowiki>