Prevents calling new_from_api on nil in Actor.all when the Actor subclasses's match? predicates don't find a suitable class.
Specifically, I have a Fritz!DECT 500 (the lightbulb¹) and it swam belly up when getting all actors. I deliberately didn't add a proper XML for the 500 as I wanted this to work with all unrecognised devices.
I sneaked in a change to attempt to assign an actor instance's name from the product name XML attribute as well, just so that I could see what devices are being returned. Happy to change it back.
NoMethodError: undefined method `new_from_api' for nil
¹) I might add a real actor subclass for it in the near future
Prevents calling
new_from_api
onnil
in Actor.all when the Actor subclasses'smatch?
predicates don't find a suitable class.Specifically, I have a Fritz!DECT 500 (the lightbulb¹) and it swam belly up when getting all actors. I deliberately didn't add a proper XML for the 500 as I wanted this to work with all unrecognised devices.
I sneaked in a change to attempt to assign an actor instance's name from the product name XML attribute as well, just so that I could see what devices are being returned. Happy to change it back.
¹) I might add a real actor subclass for it in the near future