Code:
local AddOnManager = GetAddOnManager()
for i = 1, AddOnManager:GetNumAddOns() do
local name, title, author, description, enabled, state, isOutOfDate = AddOnManager:GetAddOnInfo(i)
if title == "myaddonname" then
if isOutOfDate then
--api change!
end
end
end
Now that is the kind of data that would best be aquired once during OnLoaded event by a library and then given to other code as needed via a API calls.