{"id":13525968,"url":"https://github.com/kikito/middleclass","last_synced_at":"2025-05-15T17:08:14.142Z","repository":{"id":878672,"uuid":"622403","full_name":"kikito/middleclass","owner":"kikito","description":"Object-orientation for Lua","archived":false,"fork":false,"pushed_at":"2023-03-05T16:45:40.000Z","size":204,"stargazers_count":1813,"open_issues_count":5,"forks_count":193,"subscribers_count":85,"default_branch":"master","last_synced_at":"2025-04-07T22:10:01.410Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/kikito/middleclass","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/kikito.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2010-04-21T21:35:02.000Z","updated_at":"2025-04-07T16:05:56.000Z","dependencies_parsed_at":"2022-08-03T00:31:00.987Z","dependency_job_id":"fd789450-6631-498d-85b2-a19ef3572089","html_url":"https://github.com/kikito/middleclass","commit_stats":{"total_commits":209,"total_committers":11,"mean_commits":19.0,"dds":"0.13397129186602874","last_synced_commit":"aa8f88b31715d7a58cc52d4bc6721d55e6c84f92"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikito%2Fmiddleclass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikito%2Fmiddleclass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikito%2Fmiddleclass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kikito%2Fmiddleclass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kikito","download_url":"https://codeload.github.com/kikito/middleclass/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254384988,"owners_count":22062422,"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":[],"created_at":"2024-08-01T06:01:23.917Z","updated_at":"2025-05-15T17:08:09.132Z","avatar_url":"https://github.com/kikito.png","language":"Lua","funding_links":[],"categories":["Game Development","\u003ca name=\"object\"\u003e\u003c/a\u003eObject Orientation","Lua","Libraries","资源","Resources","OO"],"sub_categories":["Programming Frameworks \u0026 Languages","Programming Language","Object-oriented Programming","Programming Paradigms"],"readme":"middleclass\n===========\n\n[![Build Status](https://travis-ci.org/kikito/middleclass.png?branch=master)](https://travis-ci.org/kikito/middleclass)\n[![Coverage Status](https://coveralls.io/repos/kikito/middleclass/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/kikito/middleclass?branch=master)\n\nA simple OOP library for Lua. It has inheritance, metamethods (operators), class variables and weak mixin support.\n\nQuick Look\n==========\n\n```lua\nlocal class = require 'middleclass'\n\nlocal Fruit = class('Fruit') -- 'Fruit' is the class' name\n\nfunction Fruit:initialize(sweetness)\n  self.sweetness = sweetness\nend\n\nFruit.static.sweetness_threshold = 5 -- class variable (also admits methods)\n\nfunction Fruit:isSweet()\n  return self.sweetness \u003e Fruit.sweetness_threshold\nend\n\nlocal Lemon = class('Lemon', Fruit) -- subclassing\n\nfunction Lemon:initialize()\n  Fruit.initialize(self, 1) -- invoking the superclass' initializer\nend\n\nlocal lemon = Lemon:new()\n\nprint(lemon:isSweet()) -- false\n```\n\nDocumentation\n=============\n\nSee the [github wiki page](https://github.com/kikito/middleclass/wiki) for examples \u0026 documentation.\n\nYou can read the `CHANGELOG.md` file to see what has changed on each version of this library.\n\nIf you need help updating to a new middleclass version, read `UPDATING.md`.\n\nInstallation\n============\n\nJust copy the middleclass.lua file wherever you want it (for example on a lib/ folder). Then write this in any Lua file where you want to use it:\n\n```lua\nlocal class = require 'middleclass'\n```\n\nSpecs\n=====\n\nThis project uses [busted](http://olivinelabs.com/busted/) for its specs. If you want to run the specs, you will have to install it first. Then just execute the following:\n\n```bash\ncd /folder/where/the/spec/folder/is\nbusted\n```\n\nPerformance tests\n=================\n\nMiddleclass also comes with a small performance test suite. Just run the following command:\n\n```bash\nlua performance/run.lua\n```\n\nLicense\n=======\n\nMiddleclass is distributed under the MIT license.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkikito%2Fmiddleclass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkikito%2Fmiddleclass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkikito%2Fmiddleclass/lists"}