Class: ExecJS::MustangRuntime

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

Defined Under Namespace

Classes: Context

Instance Method Summary collapse

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


65
66
67
68
69
70
# File 'lib/execjs/mustang_runtime.rb', line 65

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

#compile(source) ⇒ Object



61
62
63
# File 'lib/execjs/mustang_runtime.rb', line 61

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

#eval(source) ⇒ Object



56
57
58
59
# File 'lib/execjs/mustang_runtime.rb', line 56

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

#exec(source) ⇒ Object



51
52
53
54
# File 'lib/execjs/mustang_runtime.rb', line 51

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

#nameObject



47
48
49
# File 'lib/execjs/mustang_runtime.rb', line 47

def name
  "Mustang (V8)"
end