Module: JS

Defined in:
lib/platform_specific/opal/extensions/js.rb

Overview

JS add on specific to Opal

Class Method Summary collapse

Class Method Details

.eval(string) ⇒ Object



6
7
8
9
10
# File 'lib/platform_specific/opal/extensions/js.rb', line 6

def self.eval(string)
  clean_str = string.gsub('return', '')
  result = `eval(#{clean_str})`
  Native(result)
end

.globalObject



12
13
14
# File 'lib/platform_specific/opal/extensions/js.rb', line 12

def self.global
  JS.eval('window')
end