Class: Crabfarm::CrabtrapContext
- Inherits:
-
Context
- Object
- Context
- Crabfarm::CrabtrapContext
show all
- Defined in:
- lib/crabfarm/crabtrap_context.rb
Instance Attribute Summary collapse
Attributes inherited from Context
#http, #pool, #store
Instance Method Summary
collapse
Methods inherited from Context
#loaded?, #prepare, #release, #reset
Constructor Details
#initialize(_mode = :pass, _path = nil) ⇒ CrabtrapContext
Returns a new instance of CrabtrapContext.
8
9
10
11
|
# File 'lib/crabfarm/crabtrap_context.rb', line 8
def initialize(_mode=:pass, _path=nil)
@mode = _mode
@path = _path
end
|
Instance Attribute Details
#mode ⇒ Object
Returns the value of attribute mode.
6
7
8
|
# File 'lib/crabfarm/crabtrap_context.rb', line 6
def mode
@mode
end
|
Instance Method Details
#capture(_path) ⇒ Object
21
22
23
24
25
|
# File 'lib/crabfarm/crabtrap_context.rb', line 21
def capture(_path)
@mode = :capture
@path = _path
restart
end
|
#pass_through ⇒ Object
13
14
15
16
17
18
19
|
# File 'lib/crabfarm/crabtrap_context.rb', line 13
def pass_through
if not loaded? or @mode != :pass
@mode = :pass
@path = nil
restart
end
end
|
#replay(_path) ⇒ Object
27
28
29
30
31
|
# File 'lib/crabfarm/crabtrap_context.rb', line 27
def replay(_path)
@mode = :replay
@path = _path
restart
end
|
#restart ⇒ Object
33
34
35
36
37
38
39
40
|
# File 'lib/crabfarm/crabtrap_context.rb', line 33
def restart
if not loaded?
prepare
else
stop_daemon
start_daemon
end
end
|