Class: Tako::ProxyStack

Inherits:
Object
  • Object
show all
Defined in:
lib/tako/proxy_stack.rb

Class Method Summary collapse

Class Method Details

.topObject



4
5
6
# File 'lib/tako/proxy_stack.rb', line 4

def top
  @current
end

.with_shard(proxy) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/tako/proxy_stack.rb', line 8

def with_shard(proxy)
  previous ||= @current
  @current = proxy

  yield
ensure
  @current = previous
end