Class: Crabfarm::ForkedState
- Inherits:
-
Object
- Object
- Crabfarm::ForkedState
- Extended by:
- Forwardable
- Defined in:
- lib/crabfarm/forked_state.rb
Instance Method Summary collapse
- #browser ⇒ Object
- #driver ⇒ Object
-
#initialize(_state, _name, _mutex) ⇒ ForkedState
constructor
A new instance of ForkedState.
- #lock_output ⇒ Object
Constructor Details
#initialize(_state, _name, _mutex) ⇒ ForkedState
Returns a new instance of ForkedState.
7 8 9 10 11 |
# File 'lib/crabfarm/forked_state.rb', line 7 def initialize(_state, _name, _mutex) @state = _state @name = _name @mutex = _mutex end |
Instance Method Details
#browser ⇒ Object
17 18 19 |
# File 'lib/crabfarm/forked_state.rb', line 17 def browser @browser ||= @state.browser(@name) end |
#driver ⇒ Object
13 14 15 |
# File 'lib/crabfarm/forked_state.rb', line 13 def driver @driver ||= @state.driver(@name) end |
#lock_output ⇒ Object
21 22 23 24 25 |
# File 'lib/crabfarm/forked_state.rb', line 21 def lock_output @mutex.synchronize { yield @state.output } end |