Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local by_value_metatable = {
- __index = function(t, k)
- for _, v in pairs(t) do
- if k == v then return v end
- end
- end
- }
- local uttp = {}
- uttp.statuses = {
- OK = 0,
- BAD_REQUEST = 100,
- NOT_FOUND = 101,
- VERSION_MISMATCH = 300
- }
- setmetatable(uttp.statuses, by_value_metatable)
- return uttp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement