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)


72
73
74
75
76
77
# File 'lib/execjs/ruby_racer_runtime.rb', line 72

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

#compile(source) ⇒ Object



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

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

#eval(source) ⇒ Object



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

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

#exec(source) ⇒ Object



58
59
60
61
# File 'lib/execjs/ruby_racer_runtime.rb', line 58

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

#nameObject



54
55
56
# File 'lib/execjs/ruby_racer_runtime.rb', line 54

def name
  "therubyracer (V8)"
end