Class: Uberloader::Context
- Inherits:
-
Object
- Object
- Uberloader::Context
- 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
-
#using(uberload) {|_self| ... } ⇒ Object
Set a new context and evaluate the block.
Instance Method Details
#using(uberload) {|_self| ... } ⇒ Object
Set a new context and evaluate the block.
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 |