These are chat archives for opal/opal

20th
Aug 2018
Ryan Prior
@ryanprior
Aug 20 2018 22:16
I see that Opal has a module in its stdlib for base64: https://github.com/opal/opal/blob/master/stdlib/base64.rb
However, in my code when I try to use ::Base64.encode64, it's giving me uninitialized constant Base64
Adding a require 'base64' doesn't help. Any ideas what I can do?
Ryan Prior
@ryanprior
Aug 20 2018 22:50

Update: I decided to use this approach instead:

data_encoded = `btoa(#{data})`

However, I would still be happy to learn how to actually do this with Ruby code instead of calling out to JS if somebody can explain :)