Class: Crabfarm::Context
- Inherits:
-
Object
show all
- Extended by:
- Forwardable
- Defined in:
- lib/crabfarm/context.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of Context.
7
8
9
10
|
# File 'lib/crabfarm/context.rb', line 7
def initialize
@store = StateStore.new
@loaded = false
end
|
Instance Attribute Details
#pool ⇒ Object
Returns the value of attribute pool.
5
6
7
|
# File 'lib/crabfarm/context.rb', line 5
def pool
@pool
end
|
#store ⇒ Object
Returns the value of attribute store.
5
6
7
|
# File 'lib/crabfarm/context.rb', line 5
def store
@store
end
|
Instance Method Details
#loaded? ⇒ Boolean
12
13
14
|
# File 'lib/crabfarm/context.rb', line 12
def loaded?
@loaded
end
|
#prepare ⇒ Object
16
17
18
19
20
21
|
# File 'lib/crabfarm/context.rb', line 16
def prepare
unless @loaded
load_services
@loaded = true
end
end
|
#release ⇒ Object
27
28
29
30
|
# File 'lib/crabfarm/context.rb', line 27
def release
unload_services
@loaded = false
end
|
#reset ⇒ Object
23
24
25
|
# File 'lib/crabfarm/context.rb', line 23
def reset
reset_services if @loaded
end
|