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)


71
72
73
74
75
76
# File 'lib/execjs/mustang_runtime.rb', line 71

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

#compile(source) ⇒ Object



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

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

#eval(source) ⇒ Object



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

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

#exec(source) ⇒ Object



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

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

#nameObject



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

def name
  "Mustang (V8)"
end