Skip to content

Commit

Permalink
DOCS-197 Fully qualify examples in the code with Mongo::
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmurakami-10gen committed May 2, 2012
1 parent 962c4f2 commit ca7bf20
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions lib/mongo/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ class Connection
# @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
#
Expand Down Expand Up @@ -131,10 +131,10 @@ def initialize(host=nil, port=nil, opts={})
# 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]
Expand Down
8 changes: 4 additions & 4 deletions lib/mongo/gridfs/grid_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ module InstanceMethods
# @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.
Expand Down
6 changes: 3 additions & 3 deletions lib/mongo/gridfs/grid_file_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,20 @@ def initialize(db, fs_name=Grid::DEFAULT_FS_NAME)
# @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
Expand Down
6 changes: 3 additions & 3 deletions lib/mongo/repl_set_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ class ReplSetConnection < Connection
# 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
#
Expand Down

0 comments on commit ca7bf20

Please sign in to comment.