Class: VCR::Hooks::FilteredHook
- Inherits:
-
Struct
- Object
- Struct
- VCR::Hooks::FilteredHook
- Includes:
- VariableArgsBlockCaller
- Defined in:
- lib/vcr/util/hooks.rb
Instance Attribute Summary collapse
-
#filters ⇒ Object
Returns the value of attribute filters.
-
#hook ⇒ Object
Returns the value of attribute hook.
Instance Method Summary collapse
Methods included from VariableArgsBlockCaller
Instance Attribute Details
#filters ⇒ Object
Returns the value of attribute filters
8 9 10 |
# File 'lib/vcr/util/hooks.rb', line 8 def filters @filters end |
#hook ⇒ Object
Returns the value of attribute hook
8 9 10 |
# File 'lib/vcr/util/hooks.rb', line 8 def hook @hook end |
Instance Method Details
#conditionally_invoke(*args) ⇒ Object
11 12 13 14 15 |
# File 'lib/vcr/util/hooks.rb', line 11 def conditionally_invoke(*args) filters = Array(self.filters) return if filters.any? { |f| !call_block(f.to_proc, *args) } call_block(hook, *args) end |