I'm taking baby steps with opalrb
, here is my main.rb
:
require 'native'
def main
puts "hi from the main function in main.rb"
end
def demoButton
outputDiv = Element.find('output').get(0)
puts outputDiv.methods.sort
end
It's included within <head>
after opal.js
and ...opal-parser.js" onload="Opal.load('opal-parser')"
but the console shows an exception thrown:
{
message: "cannot load such file -- native",
name: "LoadError",
stack: ""
}
native
seems to be part of the opal standard library, so why is there a problem including it?