Skip to content

Commit a7005ab

Browse files
committed
RUBY-705 Clean up API documentation
1 parent f881675 commit a7005ab

14 files changed

+25
-22
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ Installation
77

88
**Gem Installation**<br>
99
The Ruby driver is released and distributed through RubyGems and it can be installed with the following command:
10+
1011
```bash
1112
gem install mongo
1213
```
14+
1315
For a significant performance boost, you'll want to install the C-extension:
16+
1417
```bash
1518
gem install bson_ext
1619
```
20+
1721
**Github Installation**<br>
1822
For development and test environments (not recommended for production) you can also install the Ruby driver directly from source:
1923

@@ -36,6 +40,7 @@ rake install
3640
Usage
3741
-----
3842
Here is a quick example of basic usage for the Ruby driver:
43+
3944
```ruby
4045
require 'mongo'
4146
include Mongo

lib/bson/types/binary.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Binary < ByteBuffer
3535
#
3636
# @param [Array, String] data to story as BSON binary. If a string is given, the on
3737
# Ruby 1.9 it will be forced to the binary encoding.
38-
# @param [Fixnum] one of four values specifying a BSON binary subtype. Possible values are
38+
# @param [Fixnum] subtype one of four values specifying a BSON binary subtype. Possible values are
3939
# SUBTYPE_BYTES, SUBTYPE_UUID, SUBTYPE_MD5, and SUBTYPE_USER_DEFINED.
4040
#
4141
# @see http://www.mongodb.org/display/DOCS/BSON#BSON-noteondatabinary BSON binary subtypes.

lib/bson/types/code.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Code
2323
# Wrap code to be evaluated by MongoDB.
2424
#
2525
# @param [String] code the JavaScript code.
26-
# @param [Hash] a document mapping identifiers to values, which
26+
# @param [Hash] scope a document mapping identifiers to values, which
2727
# represent the scope in which the code is to be executed.
2828
def initialize(code, scope={})
2929
@code = code

lib/bson/types/dbref.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class DBRef
2121

2222
# Create a DBRef. Use this class in conjunction with DB#dereference.
2323
#
24-
# @param [String] a collection name
25-
# @param [ObjectId] an object id
24+
# @param [String] namespace a collection name.
25+
# @param [ObjectId] object_id an object id.
2626
def initialize(namespace, object_id)
2727
@namespace = namespace
2828
@object_id = object_id

lib/bson/types/regex.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Regex
3232
# Create a new regexp.
3333
#
3434
# @param pattern [String]
35-
# @param options [Array, String]
35+
# @param opts [Array, String]
3636
def initialize(pattern, *opts)
3737
@pattern = pattern
3838
@options = opts.first.is_a?(Fixnum) ? opts.first : str_opts_to_int(opts.join)

lib/mongo/collection.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def hint=(hint=nil)
159159
end
160160

161161
# Set a hint field using a named index.
162-
# @param [String] hinted index name
162+
# @param [String] hint index name
163163
def named_hint=(hint=nil)
164164
@hint = hint
165165
self

lib/mongo/cursor.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def has_next?
189189

190190
# Get the size of the result set for this query.
191191
#
192-
# @param [Boolean] whether of not to take notice of skip and limit
192+
# @param [Boolean] skip_and_limit whether or not to take skip or limit into account.
193193
#
194194
# @return [Integer] the number of objects in the result set for this query.
195195
#

lib/mongo/functional/authentication.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def issue_gssapi(auth, opts={})
296296

297297
# Helper to fetch a nonce value from a given database instance.
298298
#
299-
# @param db [Mongo::DB] The DB instance to use for issue the nonce command.
299+
# @param database [Mongo::DB] The DB instance to use for issue the nonce command.
300300
# @param opts [Hash] Hash of optional settings and configuration values.
301301
#
302302
# @option opts [Socket] socket (nil) Optional socket instance to use.

lib/mongo/functional/uri_parser.rb

-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,6 @@ class URIParser
153153
# @note Passwords can contain any character except for ','
154154
#
155155
# @param [String] uri The MongoDB URI string.
156-
# @param [Hash,nil] extra_opts Extra options. Will override anything
157-
# already specified in the URI.
158156
def initialize(uri)
159157
if uri.start_with?('mongodb://')
160158
uri = uri[10..-1]

lib/mongo/gridfs/grid.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def put(data, opts={})
8181

8282
# Read a file from the file store.
8383
#
84-
# @param [] id the file's unique id.
84+
# @param id the file's unique id.
8585
#
8686
# @return [Mongo::GridIO]
8787
def get(id)
@@ -95,7 +95,7 @@ def get(id)
9595
# is attempting to read a file while it's being deleted. While the odds for this
9696
# kind of race condition are small, it's important to be aware of.
9797
#
98-
# @param [] id
98+
# @param id
9999
#
100100
# @return [Boolean]
101101
def delete(id)

lib/mongo/gridfs/grid_io.rb

+2-4
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,9 @@ def read(length=nil)
106106

107107
# Write the given string (binary) data to the file.
108108
#
109-
# @param [String] string
110-
# the data to write
109+
# @param [String] io the data to write.
111110
#
112-
# @return [Integer]
113-
# the number of bytes written.
111+
# @return [Integer] the number of bytes written.
114112
def write(io)
115113
raise GridError, "file not opened for write" unless @mode[0] == ?w
116114
if io.is_a? String

lib/mongo/mongo_client.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def self.multi(nodes, opts={})
216216
# @param uri [String]
217217
# A string of the format mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/database]
218218
#
219-
# @param opts Any of the options available for MongoClient.new
219+
# @param [Hash] extra_opts Any of the options available for MongoClient.new
220220
#
221221
# @return [Mongo::MongoClient, Mongo::MongoReplicaSetClient]
222222
def self.from_uri(uri = ENV['MONGODB_URI'], extra_opts={})

lib/mongo/mongo_sharded_client.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ def checkout(&block)
148148
# @param uri [ String ] string of the format:
149149
# mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/database]
150150
#
151-
# @param opts [ Hash ] Any of the options available for MongoShardedClient.new
151+
# @param options [ Hash ] Any of the options available for MongoShardedClient.new
152152
#
153153
# @return [ Mongo::MongoShardedClient ] The sharded client.
154-
def self.from_uri(uri, options = {})
154+
def self.from_uri(uri, options={})
155155
uri ||= ENV['MONGODB_URI']
156156
URIParser.new(uri).connection(options, false, true)
157157
end

lib/mongo/networking.rb

+5-3
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def send_message(operation, message, opts={})
6767
# @param [Integer] operation a MongoDB opcode.
6868
# @param [BSON::ByteBuffer] message a message to send to the database.
6969
# @param [String] db_name the name of the database. used on call to get_last_error.
70-
# @param [Hash] last_error_params parameters to be sent to getLastError. See DB#error for
71-
# available options.
70+
# @param [String] log_message this is currently a no-op and will be removed.
71+
# @param [Hash] write_concern write concern.
7272
#
7373
# @see DB#get_last_error for valid last error params.
7474
#
@@ -122,8 +122,10 @@ def send_message_with_gle(operation, message, db_name, log_message=nil, write_co
122122
# @param [Socket] socket a socket to use in lieu of checking out a new one.
123123
# @param [Boolean] command (false) indicate whether this is a command. If this is a command,
124124
# the message will be sent to the primary node.
125-
# @param [Boolean] command (false) indicate whether the cursor should be exhausted. Set
125+
# @param [Symbol] read the read preference.
126+
# @param [Boolean] exhaust (false) indicate whether the cursor should be exhausted. Set
126127
# this to true only when the OP_QUERY_EXHAUST flag is set.
128+
# @param [Boolean] compile_regex whether BSON regex objects should be compiled into Ruby regexes.
127129
#
128130
# @return [Array]
129131
# An array whose indexes include [0] documents returned, [1] number of document received,

0 commit comments

Comments
 (0)