News for hackers. Stuff that matters.
Re:Opal: Ruby to JavaScript Compiler by DouweM on Thursday June 05, 2014 @12:14PM (#7852642)
Re:Opal: Ruby to JavaScript Compiler by ankurpatel on Thursday June 05, 2014 @12:46PM (#7852781)
This is not pure way of doing meta programming. It looks at the code to figure out what methods are being called in future.

Opal.add_stubs(["first", "second", "to_sym"]);

But lets say I am dynamically generating method using a string passed from user input or server then this would fail.

Re:Opal: Ruby to JavaScript Compiler by elia on Monday June 09, 2014 @09:33AM (#7868338)
I had the same fear at first, but actually if you generate dynamically a method name you need to use `#__send__` (and friends) to call it.

Of course `#__send__` supports method_missing: https://github.com/opal/opal/blob/0-6-stable/opal/corelib/ba...