methodMissing in driver code?

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?

I would probably echo the lack of response by saying your assumption is likely correct... either you cater for the callbacks or you only support (in some way) the parent devices.... Unless others have smarter options than me...

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.