Class: VCR::LibraryHooks

Inherits:
Object
  • Object
show all
Defined in:
lib/vcr/library_hooks.rb,
lib/vcr/library_hooks/excon.rb,
lib/vcr/library_hooks/faraday.rb,
lib/vcr/library_hooks/webmock.rb,
lib/vcr/library_hooks/typhoeus.rb,
lib/vcr/library_hooks/typhoeus_0.4.rb

Defined Under Namespace

Modules: Excon, Faraday, Typhoeus, WebMock

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#exclusive_hookObject

Returns the value of attribute exclusive_hook


4
5
6
# File 'lib/vcr/library_hooks.rb', line 4

def exclusive_hook
  @exclusive_hook
end

Instance Method Details

#disabled?(hook) ⇒ Boolean

Returns:

  • (Boolean)

6
7
8
# File 'lib/vcr/library_hooks.rb', line 6

def disabled?(hook)
  ![nil, hook].include?(exclusive_hook)
end

#exclusively_enabled(hook) ⇒ Object


10
11
12
13
14
15
# File 'lib/vcr/library_hooks.rb', line 10

def exclusively_enabled(hook)
  self.exclusive_hook = hook
  yield
ensure
  self.exclusive_hook = nil
end