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.
- #loaded? ⇒ Boolean
- #prepare ⇒ 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
#loaded? ⇒ Boolean
14 15 16 |
# File 'lib/crabfarm/context.rb', line 14 def loaded? @loaded end |
#prepare ⇒ Object
18 19 20 21 22 23 |
# File 'lib/crabfarm/context.rb', line 18 def prepare unless @loaded load_services @loaded = true end end |
#release ⇒ Object
29 30 31 32 |
# File 'lib/crabfarm/context.rb', line 29 def release unload_services @loaded = false end |
#reset ⇒ Object
25 26 27 |
# File 'lib/crabfarm/context.rb', line 25 def reset reset_services if @loaded end |