Class: SPV::Waiter
- Inherits:
-
Object
- Object
- SPV::Waiter
- Defined in:
- lib/site_prism_vcr/waiter.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(node, fixtures_manager, options) ⇒ Waiter
constructor
A new instance of Waiter.
- #wait ⇒ Object
- #with_new_options(options) ⇒ Object
Constructor Details
#initialize(node, fixtures_manager, options) ⇒ Waiter
Returns a new instance of Waiter.
9 10 11 12 13 |
# File 'lib/site_prism_vcr/waiter.rb', line 9 def initialize(node, fixtures_manager, ) @node, @waiter_method = node, .waiter @fixtures_manager = fixtures_manager @options = . || {} end |
Class Method Details
.wait(node, fixtures_manager, options) ⇒ Object
3 4 5 6 7 |
# File 'lib/site_prism_vcr/waiter.rb', line 3 def self.wait(node, fixtures_manager, ) waiter = new(node, fixtures_manager, ) waiter.wait waiter end |
Instance Method Details
#wait ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/site_prism_vcr/waiter.rb', line 15 def wait if @waiter_method @node.instance_eval &@waiter_method if @options.fetch(:eject_cassettes, true) @fixtures_manager.eject end end end |
#with_new_options(options) ⇒ Object
25 26 27 |
# File 'lib/site_prism_vcr/waiter.rb', line 25 def () self.class.new(@node, @fixtures_manager, ) end |