Class: MongoDbUtils::Model::ReplicaSetDb
- Defined in:
- lib/mongo-db-utils/models/db.rb
Constant Summary
Constants inherited from Db
Instance Attribute Summary collapse
-
#set_name ⇒ Object
readonly
Returns the value of attribute set_name.
Attributes inherited from Db
#name, #password, #uri, #username
Instance Method Summary collapse
-
#initialize(uri, name) ⇒ ReplicaSetDb
constructor
A new instance of ReplicaSetDb.
-
#to_host_s ⇒ Object
Note: we override this to provide a replica set format.
- #to_s ⇒ Object
Methods inherited from Db
#<=>, #authentication_required?, #to_s_simple
Constructor Details
#initialize(uri, name) ⇒ ReplicaSetDb
Returns a new instance of ReplicaSetDb.
64 65 66 67 |
# File 'lib/mongo-db-utils/models/db.rb', line 64 def initialize(uri, name) super(uri) @set_name = name end |
Instance Attribute Details
#set_name ⇒ Object (readonly)
Returns the value of attribute set_name.
63 64 65 |
# File 'lib/mongo-db-utils/models/db.rb', line 63 def set_name @set_name end |
Instance Method Details
#to_host_s ⇒ Object
Note: we override this to provide a replica set format
70 71 72 |
# File 'lib/mongo-db-utils/models/db.rb', line 70 def to_host_s "#{@set_name}/#{@host_port}" end |
#to_s ⇒ Object
74 75 76 |
# File 'lib/mongo-db-utils/models/db.rb', line 74 def to_s "[ReplicaSetDb-(#{to_host_s}/#{@name})]" end |