lib/mongo/cluster/topology.rb in mongo-2.0.2 vs lib/mongo/cluster/topology.rb in mongo-2.0.3

- old
+ new

@@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. require 'mongo/cluster/topology/replica_set' require 'mongo/cluster/topology/sharded' -require 'mongo/cluster/topology/standalone' +require 'mongo/cluster/topology/single' require 'mongo/cluster/topology/unknown' module Mongo class Cluster @@ -30,30 +30,31 @@ # # @since 2.0.0 OPTIONS = { replica_set: ReplicaSet, sharded: Sharded, - direct: Standalone + direct: Single } # Get the initial cluster topology for the provided options. # # @example Get the initial cluster topology. # Topology.initial(topology: :replica_set) # + # @param [ Array<String> ] seeds The addresses of the configured servers. # @param [ Hash ] options The cluster options. # - # @return [ ReplicaSet, Sharded, Standalone ] The topology. + # @return [ ReplicaSet, Sharded, Single ] The topology. # # @since 2.0.0 def initial(seeds, options) if options.has_key?(:connect) - return OPTIONS.fetch(options[:connect]).new(options) + return OPTIONS.fetch(options[:connect]).new(options, seeds) end if options.has_key?(:replica_set) - ReplicaSet.new(options) + ReplicaSet.new(options, seeds) else - seeds.size > 1 ? Unknown.new(options) : Standalone.new(options) + seeds.size > 1 ? Unknown.new(options, seeds) : Single.new(options, seeds) end end end end end