Class: ExecJS::JohnsonRuntime

Inherits:
Object
  • Object
show all
Defined in:
lib/execjs/johnson_runtime.rb

Defined Under Namespace

Classes: Context

Instance Method Summary collapse

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


105
106
107
108
109
110
# File 'lib/execjs/johnson_runtime.rb', line 105

def available?
  require "johnson"
  true
rescue LoadError
  false
end

#compile(source) ⇒ Object



101
102
103
# File 'lib/execjs/johnson_runtime.rb', line 101

def compile(source)
  Context.new(source)
end

#eval(source) ⇒ Object



96
97
98
99
# File 'lib/execjs/johnson_runtime.rb', line 96

def eval(source)
  context = Context.new
  context.eval(source)
end

#exec(source) ⇒ Object



91
92
93
94
# File 'lib/execjs/johnson_runtime.rb', line 91

def exec(source)
  context = Context.new
  context.exec(source)
end

#nameObject



87
88
89
# File 'lib/execjs/johnson_runtime.rb', line 87

def name
  "Johnson (SpiderMonkey)"
end