From dff5363f96029aba6d0f222d3e31ab3888d7111f Mon Sep 17 00:00:00 2001 From: rebecca Date: Thu, 24 Sep 2026 16:50:51 +0100 Subject: rename descriptor -> id because augh --- thing.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'thing.lua') 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 -- cgit v1.2.3