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)


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

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

#compile(source) ⇒ Object



83
84
85
# File 'lib/execjs/ruby_rhino_runtime.rb', line 83

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

#eval(source) ⇒ Object



78
79
80
81
# File 'lib/execjs/ruby_rhino_runtime.rb', line 78

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

#exec(source) ⇒ Object



73
74
75
76
# File 'lib/execjs/ruby_rhino_runtime.rb', line 73

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

#nameObject



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

def name
  "therubyrhino (Rhino)"
end