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)


74
75
76
77
78
79
# File 'lib/execjs/ruby_rhino_runtime.rb', line 74

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

#compile(source) ⇒ Object



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

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

#eval(source) ⇒ Object



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

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

#exec(source) ⇒ Object



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

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

#nameObject



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

def name
  "therubyrhino (Rhino)"
end