P
pedz
Is there a way to implement a type of "method_missing" concept that Ruby has? Or, equally likely, a javascript way of fulfilling the same need.
The method_missing method defined for object foo is called when foo.whatever(args) is called and whatever is not defined. The method is passed the name (whatever in this case) along with args.
Obviously I can define a function call blah and then instead of calling foo.whatever(args), I can call foo.blah("whatever", *args) but the "blah" is distracting in this case. I'm wondering if there is a way to make the "blah" not be needed.
Thank you,
pedz
The method_missing method defined for object foo is called when foo.whatever(args) is called and whatever is not defined. The method is passed the name (whatever in this case) along with args.
Obviously I can define a function call blah and then instead of calling foo.whatever(args), I can call foo.blah("whatever", *args) but the "blah" is distracting in this case. I'm wondering if there is a way to make the "blah" not be needed.
Thank you,
pedz