Module: Sandboxed::ContextHolder

Defined in:
lib/sandboxed.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



99
100
101
102
103
104
105
106
# File 'lib/sandboxed.rb', line 99

def method_missing(name, *args, &block)
  if ctx = Thread.current[:__contexts_].last
    if ctx.respond_to?(name)
      return block ? ctx.send(name, *args, &block) : ctx.send(name, *args)
    end
  end
  super
end