Class: Crabfarm::Context
- Inherits:
-
Object
- Object
- Crabfarm::Context
- Extended by:
- Forwardable
- Defined in:
- lib/crabfarm/context.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#http ⇒ Object
Returns the value of attribute http.
-
#pool ⇒ Object
Returns the value of attribute pool.
-
#store ⇒ Object
Returns the value of attribute store.
Instance Method Summary collapse
-
#initialize ⇒ Context
constructor
A new instance of Context.
- #load ⇒ Object
- #release ⇒ Object
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Context
Returns a new instance of Context.
9 10 11 12 |
# File 'lib/crabfarm/context.rb', line 9 def initialize @store = StateStore.new @loaded = false end |
Instance Attribute Details
#http ⇒ Object
Returns the value of attribute http.
7 8 9 |
# File 'lib/crabfarm/context.rb', line 7 def http @http end |
#pool ⇒ Object
Returns the value of attribute pool.
7 8 9 |
# File 'lib/crabfarm/context.rb', line 7 def pool @pool end |
#store ⇒ Object
Returns the value of attribute store.
7 8 9 |
# File 'lib/crabfarm/context.rb', line 7 def store @store end |
Instance Method Details
#load ⇒ Object
14 15 16 17 18 19 |
# File 'lib/crabfarm/context.rb', line 14 def load init_phantom_if_required init_driver_pool init_http_client @loaded = true end |
#release ⇒ Object
26 27 28 29 30 |
# File 'lib/crabfarm/context.rb', line 26 def release release_driver_pool release_phantom @loaded = false end |
#reset ⇒ Object
21 22 23 24 |
# File 'lib/crabfarm/context.rb', line 21 def reset @store.reset @pool.reset unless @pool.nil? end |