summaryrefslogtreecommitdiff
path: root/thing.lua
diff options
context:
space:
mode:
authorrebecca <ubq323@ubq323.website>2026-09-24 16:50:51 +0100
committerrebecca <ubq323@ubq323.website>2026-09-24 18:20:50 +0100
commitdff5363f96029aba6d0f222d3e31ab3888d7111f (patch)
treedfa1877b3fce2725952aaf91b818a8c673f1af83 /thing.lua
parent3f54007ab621d2e6b652523259b1cb2d3d158e22 (diff)
rename descriptor -> id because augh
Diffstat (limited to 'thing.lua')
-rw-r--r--thing.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/thing.lua b/thing.lua
index 33a4bb1..f7cc32a 100644
--- a/thing.lua
+++ b/thing.lua
@@ -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