Module: GH

Extended by:
SingleForwardable
Defined in:
lib/gh.rb,
lib/gh/case.rb,
lib/gh/cache.rb,
lib/gh/stack.rb,
lib/gh/remote.rb,
lib/gh/version.rb,
lib/gh/wrapper.rb,
lib/gh/response.rb,
lib/gh/normalizer.rb,
lib/gh/lazy_loader.rb

Defined Under Namespace

Modules: Case Classes: Cache, LazyLoader, Normalizer, Remote, Response, Stack, Wrapper

Constant Summary collapse

DefaultStack =
Stack.new do
  use LazyLoader
  use Cache
  use Normalizer
  use Remote
end
VERSION =

Public: Library version.

"0.1.0"

Class Method Summary collapse

Class Method Details

.currentObject



23
24
25
# File 'lib/gh.rb', line 23

def self.current
  Thread.current[:GH] ||= DefaultStack.new
end

.current=(backend) ⇒ Object



27
28
29
# File 'lib/gh.rb', line 27

def self.current=(backend)
  Thread.current[:GH] = backend
end

.with(backend) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/gh.rb', line 15

def self.with(backend)
  backend = DefaultStack.build(backend) if Hash === backend
  was, self.current = current, backend
  yield
ensure
  self.current = was
end