Class: ExecJS::RubyRacerRuntime

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

Defined Under Namespace

Classes: Context

Instance Method Summary collapse

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


80
81
82
83
84
85
# File 'lib/execjs/ruby_racer_runtime.rb', line 80

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

#compile(source) ⇒ Object



76
77
78
# File 'lib/execjs/ruby_racer_runtime.rb', line 76

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

#eval(source) ⇒ Object



71
72
73
74
# File 'lib/execjs/ruby_racer_runtime.rb', line 71

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

#exec(source) ⇒ Object



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

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

#nameObject



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

def name
  "therubyracer (V8)"
end