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)


110
111
112
113
114
115
# File 'lib/execjs/ruby_racer_runtime.rb', line 110

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

#compile(source) ⇒ Object



106
107
108
# File 'lib/execjs/ruby_racer_runtime.rb', line 106

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

#eval(source) ⇒ Object



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

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

#exec(source) ⇒ Object



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

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

#nameObject



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

def name
  "therubyracer (V8)"
end