All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lua.model.mustache Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
{{#models}}
{{#model}}
{{>partial_header}}
-- {{classname}} class
local {{classname}} = {}
local {{classname}}_mt = {
	__name = "{{classname}}";
	__index = {{classname}};
}

local function cast_{{classname}}(t)
	return setmetatable(t, {{classname}}_mt)
end

local function new_{{classname}}({{#vars}}{{name}}{{^-last}}, {{/-last}}{{/vars}})
	return cast_{{classname}}({
		{{#vars}}
		["{{baseName}}"] = {{name}};
		{{/vars}}
	})
end

return {
	cast = cast_{{classname}};
	new = new_{{classname}};
}
{{/model}}
{{/models}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy