I'm trying to keep the code in Filtered Device Mirror unaware of details of the supported device types, with all the specifics defined in the map of supported types.
Since the Generic Component Switch calls componentOn()
and componentOff()
methods on its parents, those methods are inherently not generic, which makes me sad. I tried to work around this by implementing methodMissing()
, but attempts to refer to parent
in that method tell me that I can't get a property off a null object. It's a very odd error.
Is there a way to do this generically, or should I just accept that I'll need to add type-specific methods for any supported child types that call back into my driver?