{"id":22035707,"url":"https://github.com/yagocrispim/lua_class","last_synced_at":"2025-03-23T12:28:18.184Z","repository":{"id":213429767,"uuid":"694633046","full_name":"YagoCrispim/lua_class","owner":"YagoCrispim","description":"Classes in Lua","archived":false,"fork":false,"pushed_at":"2024-11-09T16:46:38.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-30T10:30:15.317Z","etag":null,"topics":["class","lua","object-oriented-programming","oop"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YagoCrispim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-21T11:42:03.000Z","updated_at":"2024-11-09T16:46:28.000Z","dependencies_parsed_at":"2024-01-03T13:45:09.869Z","dependency_job_id":"67177dc8-ba31-43fa-8a41-d06ecc681b9b","html_url":"https://github.com/YagoCrispim/lua_class","commit_stats":null,"previous_names":["yagocrispim/lua-class","yagocrispim/lua_class"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YagoCrispim%2Flua_class","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YagoCrispim%2Flua_class/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YagoCrispim%2Flua_class/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YagoCrispim%2Flua_class/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YagoCrispim","download_url":"https://codeload.github.com/YagoCrispim/lua_class/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236072199,"owners_count":19090403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["class","lua","object-oriented-programming","oop"],"created_at":"2024-11-30T10:26:10.312Z","updated_at":"2025-01-28T18:47:35.193Z","avatar_url":"https://github.com/YagoCrispim.png","language":"Lua","readme":"# lua-class\n\n## Example\n\n```lua\nlocal class = require \"src.class\"\n\nlocal LogAllTrait = {\n  log_all = function(self)\n    print(\"Name: \" .. self.name)\n    print(\"Age: \" .. self.age)\n    print(\"SecretName: \" .. self.secret_name)\n    print(\"AgentId: \" .. self.agent_id)\n  end\n}\n\nlocal SecretAgent = class {\n  __use = { LogAllTrait },\n\n  constructor = function(self, params)\n    self.secret_name = 'Confidential'\n    self.agent_id = params.agent_id\n  end,\n\n  super_method = function()\n    print(\"[SecretAgent]: Super method\")\n  end\n}\n\nlocal Person = class {\n  __extends = SecretAgent,\n  constructor = function(self, params)\n    self:super(params)\n    self.name = params.name\n    self.age = params.age\n  end,\n\n  class_method = function()\n    print(\"[Person]: Class method\")\n  end\n}\n\nlocal john = Person:new({ name = \"John Doe\", age = 21, agent_id = 123 })\nlocal jane = Person:new({ name = \"Jane Doe\", age = 20, agent_id = 456 })\n\n--\n\njohn:log_all()\njohn:class_method()\njohn:super_method()\n\nprint('---')\n\njane:log_all()\njane:class_method()\njane:super_method()\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyagocrispim%2Flua_class","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyagocrispim%2Flua_class","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyagocrispim%2Flua_class/lists"}