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
9 10 11 |
# File 'lib/vcr/util/hooks.rb', line 9 def filters @filters end |
#hook ⇒ Object
Returns the value of attribute hook
9 10 11 |
# File 'lib/vcr/util/hooks.rb', line 9 def hook @hook end |
Instance Method Details
#conditionally_invoke(*args) ⇒ Object
12 13 14 15 16 |
# File 'lib/vcr/util/hooks.rb', line 12 def conditionally_invoke(*args) filters = Array(self.filters) return if filters.any? { |f| !call_block(f.to_proc, *args) } call_block(hook, *args) end |