Sha256: 92b55ac956b744f99191eac6e540a0f6a2844ecf13635b349e920963edb1ec83

Contents?: true

Size: 299 Bytes

Versions: 2

Compression:

Stored size: 299 Bytes

Contents

module VCR
  class LibraryHooks
    def initialize
      @exclusive_hook = nil
    end

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

    def exclusively_enabled(hook)
      @exclusive_hook = hook
      yield
    ensure
      @exclusive_hook = nil
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vcr-2.0.0.beta2 lib/vcr/library_hooks.rb
vcr-2.0.0.beta1 lib/vcr/library_hooks.rb