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: 3.0.0-rc1
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}}{{#hasMore}}, {{/hasMore}}{{/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