Module: Nashorn::Ruby
- Defined in:
- lib/nashorn/ruby.rb,
lib/nashorn/rhino.rb,
lib/nashorn/ruby/access.rb,
lib/nashorn/ruby/default_access.rb,
lib/nashorn/ruby/attribute_access.rb
Defined Under Namespace
Modules: Scriptable
Classes: AccessBase, AttributeAccess, Constructor, DefaultAccess, Exception, Function, Object
Constant Summary
collapse
- @@access =
nil
Class Method Summary
collapse
Class Method Details
7
|
# File 'lib/nashorn/ruby.rb', line 7
def self.access; @@access ||= Ruby::DefaultAccess.new end
|
.access=(access) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/nashorn/ruby.rb', line 9
def self.access=(access)
@@access = ( access.respond_to?(:get) && access.respond_to?(:put) ) ? access :
begin
access =
if access && ! access.is_a?(Class) name = access.to_s.chomp('_access')
name = name[0, 1].capitalize << name[1..-1]
name = :"#{name}Access"
if Ruby.const_defined?(name)
Ruby.const_get(name) else
const_get(name) end
else access
end
access.is_a?(Class) ? access.new : access
end
end
|
.cache(key, &block) ⇒ Object
352
353
354
355
356
357
|
# File 'lib/nashorn/ruby.rb', line 352
def self.cache(key, &block)
return yield
end
|
.wrap_error(e, backtrace = nil) ⇒ Object
373
374
375
376
377
|
# File 'lib/nashorn/ruby.rb', line 373
def self.wrap_error(e, backtrace = nil)
js_error = Exception.new(e)
js_error.set_backtrace(backtrace) if backtrace
js_error
end
|