Class: Mongo::Server::Description::Inspector::DescriptionChanged
- Inherits:
-
Object
- Object
- Mongo::Server::Description::Inspector::DescriptionChanged
- Includes:
- Event::Publisher
- Defined in:
- lib/mongo/server/description/inspector/description_changed.rb
Overview
Handles inspecting the result of an ismaster command for servers added to the cluster.
Instance Attribute Summary
Attributes included from Event::Publisher
Instance Method Summary collapse
-
#initialize(event_listeners) ⇒ DescriptionChanged
constructor
Instantiate the server added inspection.
-
#run(description, updated) ⇒ Object
Run the server added inspection.
Methods included from Event::Publisher
Constructor Details
#initialize(event_listeners) ⇒ DescriptionChanged
Instantiate the server added inspection.
35 36 37 |
# File 'lib/mongo/server/description/inspector/description_changed.rb', line 35 def initialize(event_listeners) @event_listeners = event_listeners end |
Instance Method Details
#run(description, updated) ⇒ Object
Run the server added inspection.
48 49 50 51 52 |
# File 'lib/mongo/server/description/inspector/description_changed.rb', line 48 def run(description, updated) unless (description.unknown? && updated.unknown?) || (description == updated) publish(Event::DESCRIPTION_CHANGED, description, updated) end end |