Class: Uberloader::Context

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/uberloader/context.rb

Overview

A wrapper around the current uberload, allowing a single block arg to be used no matter how deep we nest uberloads.

Instance Method Summary collapse

Instance Method Details

#using(uberload) {|_self| ... } ⇒ Object

Set a new context and evaluate the block.

Parameters:

Yields:

  • (_self)

Yield Parameters:



12
13
14
15
16
17
# File 'lib/uberloader/context.rb', line 12

def using(uberload)
  prev = @uberload
  @uberload = uberload
  yield self
  @uberload = prev
end