Sha256: eb1f5978ec93d02ff5e10d9f7ffa89bae1b97658c722f466ab611cb66ba982c5

Contents?: true

Size: 433 Bytes

Versions: 2

Compression:

Stored size: 433 Bytes

Contents

# frozen_string_literal: true


# JS to ruby example & ruby to js example

def my_ruby_meth(val)
  alert "kool from rb_meth: #{val}"
end

opal_js_code=<<STR
function my_js_fct(val){
    Opal.eval("my_ruby_meth('"+val+"')");
    Opal.Object.$my_ruby_meth(val);
}
STR


ruby_wasm_js_code=<<STR
function my_js_fct(val){
    rubyVM.eval("my_ruby_meth('"+val+"')");
}
STR



JS.eval("my_js_fct('hello')")
JS.global.my_js_fct('super')




Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
atome-0.5.6.6.9 vendor/assets/application/examples/js&ruby.rb
atome-0.5.6.6.9 vendor/assets/application/examples/test.rb