Class: Mongo::Cluster::AppMetadata Private
- Inherits:
-
Object
- Object
- Mongo::Cluster::AppMetadata
- Extended by:
- Forwardable
- Defined in:
- lib/mongo/cluster/app_metadata.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Application metadata that is sent to the server in an ismaster command,
when a new connection is established.
Constant Summary collapse
- MAX_DOCUMENT_SIZE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The max application metadata document byte size.
512.freeze
- MAX_APP_NAME_SIZE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The max application name byte size.
@ since 2.4.0
128.freeze
- DRIVER_NAME =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The driver name.
@ since 2.4.0
'mongo-ruby-driver'
Instance Method Summary collapse
-
#initialize(cluster) ⇒ AppMetadata
constructor
private
Instantiate the new AppMetadata object.
-
#ismaster_bytes ⇒ String
private
Get the bytes of the ismaster message including this metadata.
Constructor Details
#initialize(cluster) ⇒ AppMetadata
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Instantiate the new AppMetadata object.
54 55 56 57 |
# File 'lib/mongo/cluster/app_metadata.rb', line 54 def initialize(cluster) @app_name = cluster.[:app_name] @platform = cluster.[:platform] end |
Instance Method Details
#ismaster_bytes ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get the bytes of the ismaster message including this metadata.
69 70 71 |
# File 'lib/mongo/cluster/app_metadata.rb', line 69 def ismaster_bytes @ismaster_bytes ||= validate! && serialize.to_s end |