lib/elevate/task_context.rb in elevate-0.5.0 vs lib/elevate/task_context.rb in elevate-0.6.0
- old
+ new
@@ -1,5 +1,11 @@
module Elevate
+ # A blank slate for hosting task blocks.
+ #
+ # Because task blocks run in another thread, it is dangerous to expose them
+ # to the calling context. This class acts as a sandbox for task blocks.
+ #
+ # @api private
class TaskContext
def initialize(args, &block)
metaclass = class << self; self; end
metaclass.send(:define_method, :execute, &block)