Class: ExecJS::RubyRhinoRuntime

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

Defined Under Namespace

Classes: Context

Instance Method Summary collapse

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


70
71
72
73
74
75
# File 'lib/execjs/ruby_rhino_runtime.rb', line 70

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

#compile(source) ⇒ Object



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

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

#eval(source) ⇒ Object



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

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

#exec(source) ⇒ Object



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

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

#nameObject



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

def name
  "therubyrhino (Rhino)"
end