https://github.com/alphafantomu/orcus-getter
a orcus handler extension for getter attributes for classes
https://github.com/alphafantomu/orcus-getter
Last synced: 5 days ago
JSON representation
a orcus handler extension for getter attributes for classes
- Host: GitHub
- URL: https://github.com/alphafantomu/orcus-getter
- Owner: alphafantomu
- License: mit
- Created: 2022-03-07T09:07:15.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-12T02:28:45.000Z (over 3 years ago)
- Last Synced: 2025-02-21T13:25:21.023Z (over 1 year ago)
- Language: Lua
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# orcus-getter
a orcus extension for getter attributes for classes
## Dependencies
- [orcus](https://github.com/alphafantomu/orcus)
## Installation
- Make sure you have [luvit](https://luvit.io/install.html) installed
- Run the command `lit install alphafantomu/orcus-getter`
- `require('orcus-getter')` to reference the library
- There is no [LuaRocks](https://luarocks.org/) release, but only `init.lua` is necessary to use the library.
## Usage
The usage is really simple `getter(closure_function, should_cache)`, here is an example
```lua
local getter = require('orcus-getter');
local block = require('orcus', {
nickname = 'Three Dimensional Square';
});
block.name = getter(function(self)
return self.nickname;
end, true); -- cache the value
print(block.name); --"Three Dimensional Square"
```
## License
This project has an [MIT license](/LICENSE)
## Contact
- Discord: `Arivistraliavatoriar#2678`