local class = require'r.class' -- author or channel or whatever -- tuple of (pylon, pylon-specific-descriptor (id), optional display name) local Thing = class() function Thing.make(cls, pylon, id, name) name = name or id return setmetatable({ pylon=pylon, id=id, name=name, }, cls) end function Thing.__eq(self, other) return self.pylon == other.pylon and self.id == other.id end function Thing.__tostring(self) return self.pylon.name .. ':' .. self.id .. (self.name == self.id and '('..self.name..')' or '') end function Thing.name_with_shortname(self) return self.name .. ' [' .. self.pylon.shortname .. ']' end return Thing