Skip to content

Instantly share code, notes, and snippets.

@videlais
Created April 13, 2018 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save videlais/e1a5a1e58b09870801241b1d438f0f0e to your computer and use it in GitHub Desktop.
Save videlais/e1a5a1e58b09870801241b1d438f0f0e to your computer and use it in GitHub Desktop.
person.lua
Person = {}
function Person:new()
newObj = {name = 'Dan'}
self.__index = self
return setmetatable(newObj, self)
end
function Person:sayName()
print('My name is ' .. self.name)
end
newPerson = Person:new()
newPerson:sayName()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment