Advertisement
Pinkishu

Untitled

Feb 23rd, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.32 KB | None | 0 0
  1. Person = {}
  2. local PersonInj = {}
  3.  
  4. function Person.inject(table)
  5.     setmetatable(table,{__index=PersonInj})
  6.     return table
  7. end
  8.  
  9. function Person.new(name)
  10.     local tab = {}
  11.     tab.name = name
  12.     return Person.inject(tab)
  13. end
  14.  
  15.  
  16.  
  17. -------
  18.  
  19. function PersonInj:setName(newName)
  20.     self.name = newName
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement