Class: Mongo::Event::DescriptionChanged
- Inherits:
-
Object
- Object
- Mongo::Event::DescriptionChanged
- Defined in:
- lib/mongo/event/description_changed.rb
Overview
This handles a change in description.
Instance Attribute Summary collapse
-
#cluster ⇒ Mongo::Cluster
readonly
Cluster The event publisher.
Instance Method Summary collapse
-
#handle(updated) ⇒ Object
This event publishes an event to add the cluster and logs the configuration change.
-
#initialize(cluster) ⇒ DescriptionChanged
constructor
Initialize the new host added event handler.
Constructor Details
#initialize(cluster) ⇒ DescriptionChanged
Initialize the new host added event handler.
35 36 37 |
# File 'lib/mongo/event/description_changed.rb', line 35 def initialize(cluster) @cluster = cluster end |
Instance Attribute Details
#cluster ⇒ Mongo::Cluster (readonly)
Returns cluster The event publisher.
25 26 27 |
# File 'lib/mongo/event/description_changed.rb', line 25 def cluster @cluster end |
Instance Method Details
#handle(updated) ⇒ Object
This event publishes an event to add the cluster and logs the configuration change.
48 49 50 51 |
# File 'lib/mongo/event/description_changed.rb', line 48 def handle(updated) cluster.add_hosts(updated) cluster.remove_hosts(updated) end |