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)


94
95
96
97
98
99
# File 'lib/execjs/ruby_rhino_runtime.rb', line 94

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

#compile(source) ⇒ Object



90
91
92
# File 'lib/execjs/ruby_rhino_runtime.rb', line 90

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

#eval(source) ⇒ Object



85
86
87
88
# File 'lib/execjs/ruby_rhino_runtime.rb', line 85

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

#exec(source) ⇒ Object



80
81
82
83
# File 'lib/execjs/ruby_rhino_runtime.rb', line 80

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

#nameObject



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

def name
  "therubyrhino (Rhino)"
end