diff options
| author | rebecca <ubq323@ubq323.website> | 2026-09-24 16:50:51 +0100 |
|---|---|---|
| committer | rebecca <ubq323@ubq323.website> | 2026-09-24 18:20:50 +0100 |
| commit | dff5363f96029aba6d0f222d3e31ab3888d7111f (patch) | |
| tree | dfa1877b3fce2725952aaf91b818a8c673f1af83 /thing.lua | |
| parent | 3f54007ab621d2e6b652523259b1cb2d3d158e22 (diff) | |
rename descriptor -> id because augh
Diffstat (limited to 'thing.lua')
| -rw-r--r-- | thing.lua | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1,22 +1,22 @@ local class = require'r.class' -- author or channel or whatever --- tuple of (pylon, pylon-specific-descriptor, optional displayname) +-- tuple of (pylon, pylon-specific-descriptor (id), optional display name) local Thing = class() -function Thing.make(cls, pylon, descriptor, displayname) - displayname = displayname or descriptor +function Thing.make(cls, pylon, id, name) + name = name or id return setmetatable({ pylon=pylon, - descriptor=descriptor, - displayname=displayname, + id=id, + name=name, }, cls) end function Thing.__eq(self, other) - return self.pylon == other.pylon and self.descriptor == other.descriptor + return self.pylon == other.pylon and self.id == other.id end function Thing.__tostring(self) return self.pylon.name - .. ':' .. self.descriptor - .. (self.displayname == self.descriptor and '('..self.displayname..')' or '') + .. ':' .. self.id + .. (self.name == self.id and '('..self.name..')' or '') end return Thing |
