These are chat archives for opal/opal

19th
Sep 2016
Yehonathan Sharvit
@viebel
Sep 19 2016 04:52
Who can help?
Ilya Bylich
@iliabylich
Sep 19 2016 10:13
Yehonathan Sharvit
@viebel
Sep 19 2016 10:16
Thanks @iliabylich but I need the result as a string and not in the console
Ilya Bylich
@iliabylich
Sep 19 2016 10:26
Then most probably you need Opal.eval(code).$inspect()
code = "[1,2,3] * 2"; Opal.eval(code).$inspect()
# => "[1, 2, 3, 1, 2, 3]"
Yehonathan Sharvit
@viebel
Sep 19 2016 11:17
Wonderful!!! Many thanks @iliabylich
Have a look at this tool I built on top of Opal: http://blog.klipse.tech/ruby/2016/06/20/blog-ruby.html
Ilya Bylich
@iliabylich
Sep 19 2016 11:18
One more thing to mention - method $inspect is available for all Opal objects, but sometimes your code may return null/undefined
Yehonathan Sharvit
@viebel
Sep 19 2016 11:25
Thanks.
The same will happen with anything that is not defined
Loïc Boutet
@loicboutet
Sep 19 2016 19:56
@viebel Klipse is amazing !