From ca7bf209ddf1d7955df556602bd2eb704ee22d15 Mon Sep 17 00:00:00 2001 From: Gary Murakami Date: Wed, 2 May 2012 17:43:54 -0400 Subject: [PATCH] DOCS-197 Fully qualify examples in the code with Mongo:: --- lib/mongo/connection.rb | 12 ++++++------ lib/mongo/gridfs/grid_ext.rb | 8 ++++---- lib/mongo/gridfs/grid_file_system.rb | 6 +++--- lib/mongo/repl_set_connection.rb | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/mongo/connection.rb b/lib/mongo/connection.rb index cf6743d..e8eaf58 100644 --- a/lib/mongo/connection.rb +++ b/lib/mongo/connection.rb @@ -77,16 +77,16 @@ module Mongo # @option opts [Boolean] :ssl (false) If true, create the connection to the server using SSL. # # @example localhost, 27017 - # Connection.new + # Mongo::Connection.new # # @example localhost, 27017 - # Connection.new("localhost") + # Mongo::Connection.new("localhost") # # @example localhost, 3000, max 5 self.connections, with max 5 seconds of wait time. - # Connection.new("localhost", 3000, :pool_size => 5, :timeout => 5) + # Mongo::Connection.new("localhost", 3000, :pool_size => 5, :timeout => 5) # # @example localhost, 3000, where this node may be a slave - # Connection.new("localhost", 3000, :slave_ok => true) + # Mongo::Connection.new("localhost", 3000, :slave_ok => true) # # @see http://api.mongodb.org/ruby/current/file.REPLICA_SETS.html Replica sets in Ruby # @@ -131,10 +131,10 @@ module Mongo # to send reads to. # # @example - # Connection.multi([["db1.example.com", 27017], ["db2.example.com", 27017]]) + # Mongo::Connection.multi([["db1.example.com", 27017], ["db2.example.com", 27017]]) # # @example This connection will read from a random secondary node. - # Connection.multi([["db1.example.com", 27017], ["db2.example.com", 27017], ["db3.example.com", 27017]], + # Mongo::Connection.multi([["db1.example.com", 27017], ["db2.example.com", 27017], ["db3.example.com", 27017]], # :read_secondary => true) # # @return [Mongo::Connection] diff --git a/lib/mongo/gridfs/grid_ext.rb b/lib/mongo/gridfs/grid_ext.rb index c7371f0..c28cdd2 100644 --- a/lib/mongo/gridfs/grid_ext.rb +++ b/lib/mongo/gridfs/grid_ext.rb @@ -33,19 +33,19 @@ module Mongo # @example # # # Check for the existence of a given filename - # @grid = GridFileSystem.new(@db) + # @grid = Mongo::GridFileSystem.new(@db) # @grid.exist?(:filename => 'foo.txt') # # # Check for existence filename and content type - # @grid = GridFileSystem.new(@db) + # @grid = Mongo::GridFileSystem.new(@db) # @grid.exist?(:filename => 'foo.txt', :content_type => 'image/jpg') # # # Check for existence by _id - # @grid = Grid.new(@db) + # @grid = Mongo::Grid.new(@db) # @grid.exist?(:_id => BSON::ObjectId.from_string('4bddcd24beffd95a7db9b8c8')) # # # Check for existence by an arbitrary attribute. - # @grid = Grid.new(@db) + # @grid = Mongo::Grid.new(@db) # @grid.exist?(:tags => {'$in' => ['nature', 'zen', 'photography']}) # # @return [nil, Hash] either nil for the file's metadata as a hash. diff --git a/lib/mongo/gridfs/grid_file_system.rb b/lib/mongo/gridfs/grid_file_system.rb index 437e75e..b37c862 100644 --- a/lib/mongo/gridfs/grid_file_system.rb +++ b/lib/mongo/gridfs/grid_file_system.rb @@ -78,20 +78,20 @@ module Mongo # @example # # # Store the text "Hello, world!" in the grid file system. - # @grid = GridFileSystem.new(@db) + # @grid = Mongo::GridFileSystem.new(@db) # @grid.open('filename', 'w') do |f| # f.write "Hello, world!" # end # # # Output "Hello, world!" - # @grid = GridFileSystem.new(@db) + # @grid = Mongo::GridFileSystem.new(@db) # @grid.open('filename', 'r') do |f| # puts f.read # end # # # Write a file on disk to the GridFileSystem # @file = File.open('image.jpg') - # @grid = GridFileSystem.new(@db) + # @grid = Mongo::GridFileSystem.new(@db) # @grid.open('image.jpg, 'w') do |f| # f.write @file # end diff --git a/lib/mongo/repl_set_connection.rb b/lib/mongo/repl_set_connection.rb index 1076a87..aab385a 100644 --- a/lib/mongo/repl_set_connection.rb +++ b/lib/mongo/repl_set_connection.rb @@ -68,13 +68,13 @@ module Mongo # The purpose of seed nodes is to permit the driver to find at least one replica set member even if a member is down. # # @example Connect to a replica set and provide two seed nodes. - # ReplSetConnection.new(['localhost:30000', 'localhost:30001']) + # Mongo::ReplSetConnection.new(['localhost:30000', 'localhost:30001']) # # @example Connect to a replica set providing two seed nodes and ensuring a connection to the replica set named 'prod': - # ReplSetConnection.new(['localhost:30000', 'localhost:30001'], :name => 'prod') + # Mongo::ReplSetConnection.new(['localhost:30000', 'localhost:30001'], :name => 'prod') # # @example Connect to a replica set providing two seed nodes and allowing reads from a secondary node: - # ReplSetConnection.new(['localhost:30000', 'localhost:30001'], :read => :secondary) + # Mongo::ReplSetConnection.new(['localhost:30000', 'localhost:30001'], :read => :secondary) # # @see http://api.mongodb.org/ruby/current/file.REPLICA_SETS.html Replica sets in Ruby #