Class: Copland::Implementation::StartupClient
- Inherits:
-
Object
- Object
- Copland::Implementation::StartupClient
- Defined in:
- lib/copland/impl/startup.rb
Overview
This wraps a single service as a client to the Startup service. It provides the necessary #before? and #after? abstractions required by the Orderer module (which is used by Startup to order the clients before starting them).
Instance Attribute Summary collapse
-
#after ⇒ Object
readonly
The array of names of service points that should start before this service point.
-
#before ⇒ Object
readonly
The array of names of service points that should start after this service point.
-
#point ⇒ Object
readonly
The service point that is wrapped by this object.
Instance Method Summary collapse
-
#after?(e) ⇒ Boolean
Returns
true
ifself
should be after beforee
. -
#before?(e) ⇒ Boolean
Returns
true
ifself
should be started beforee
. -
#initialize(point, before, after) ⇒ StartupClient
constructor
Instantiate a new client that wraps the given service point, and its before and after lists.
Constructor Details
#initialize(point, before, after) ⇒ StartupClient
Instantiate a new client that wraps the given service point, and its before and after lists. These lists should be arrays of the full names of other services.
59 60 61 62 63 |
# File 'lib/copland/impl/startup.rb', line 59 def initialize( point, before, after ) @point = point @before = before @after = after end |
Instance Attribute Details
#after ⇒ Object (readonly)
The array of names of service points that should start before this service point.
54 55 56 |
# File 'lib/copland/impl/startup.rb', line 54 def after @after end |
#before ⇒ Object (readonly)
The array of names of service points that should start after this service point.
50 51 52 |
# File 'lib/copland/impl/startup.rb', line 50 def before @before end |
#point ⇒ Object (readonly)
The service point that is wrapped by this object.
46 47 48 |
# File 'lib/copland/impl/startup.rb', line 46 def point @point end |
Instance Method Details
#after?(e) ⇒ Boolean
Returns true
if self
should be after before e
.
72 73 74 75 |
# File 'lib/copland/impl/startup.rb', line 72 def after?( e ) @after.include?( e.point.full_name ) || e.before.include?( point.full_name ) end |
#before?(e) ⇒ Boolean
Returns true
if self
should be started before e
.
66 67 68 69 |
# File 'lib/copland/impl/startup.rb', line 66 def before?( e ) @before.include?( e.point.full_name ) || e.after.include?( point.full_name ) end |