Skip to content

Commit 04ac4ed

Browse files
committed
Fix yard doc warnings
1 parent 4aadeb3 commit 04ac4ed

File tree

4 files changed

+45
-33
lines changed

4 files changed

+45
-33
lines changed

lib/mongo/dbref.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def initialize(collection, id, database = nil)
7979
# @example Convert the DBRef to raw BSON.
8080
# dbref.to_bson
8181
#
82-
# @param [ String ] encoded The encoded BSON to append to.
82+
# @param [ String ] buffer The encoded BSON buffer to append to.
8383
#
8484
# @return [ String ] The raw BSON.
8585
#
@@ -92,7 +92,7 @@ module ClassMethods
9292

9393
# Deserialize the hash from BSON, converting to a DBRef if appropriate.
9494
#
95-
# @param [ IO ] bson The bson representing a hash.
95+
# @param [ String ] buffer The bson representing a hash.
9696
#
9797
# @return [ Hash, DBRef ] The decoded hash or DBRef.
9898
#

lib/mongo/grid/file/chunk.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def initialize(document)
128128
# @example Convert the chunk to BSON.
129129
# chunk.to_bson
130130
#
131-
# @param [ String ] encoded The encoded data to append to.
131+
# @param [ String ] buffer The encoded data buffer to append to.
132132
#
133133
# @return [ String ] The raw BSON data.
134134
#

lib/mongo/protocol/bit_vector.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class BitVector
2424

2525
# Initializes a BitVector with a layout
2626
#
27-
# @param layout [Array<Symbol>] the array of fields in the bit vector
27+
# @param layout [ Array<Symbol> ] the array of fields in the bit vector
2828
def initialize(layout)
2929
@masks = {}
3030
layout.each_with_index do |field, index|
@@ -34,9 +34,10 @@ def initialize(layout)
3434

3535
# Serializes vector by encoding each symbol according to its mask
3636
#
37-
# @param buffer [IO] Buffer to receive the serialized vector
38-
# @param value [Array<Symbol>] Array of flags to encode
39-
# @return [IO] Buffer that received the serialized vector
37+
# @param buffer [ String ] Buffer to receive the serialized vector
38+
# @param value [ Array<Symbol> ] Array of flags to encode
39+
#
40+
# @return [ String ] Buffer that received the serialized vector
4041
def serialize(buffer, value)
4142
bits = 0
4243
value.each { |flag| bits |= @masks[flag] }
@@ -45,8 +46,9 @@ def serialize(buffer, value)
4546

4647
# Deserializes vector by decoding the symbol according to its mask
4748
#
48-
# @param io [IO] Stream containing the vector to be deserialized
49-
# @return [Array<Symbol>] Flags contained in the vector
49+
# @param [ String ] buffer Buffer containing the vector to be deserialized.
50+
#
51+
# @return [ Array<Symbol> ] Flags contained in the vector
5052
def deserialize(buffer)
5153
vector = buffer.get_int32
5254
flags = []

lib/mongo/protocol/serializers.rb

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,19 @@ module Header
4646

4747
# Serializes the header value into the buffer
4848
#
49-
# @param buffer [String] Buffer to receive the serialized value.
50-
# @param value [String] Header value to be serialized.
51-
# @return [String] Buffer with serialized value.
49+
# @param buffer [ String ] Buffer to receive the serialized value.
50+
# @param value [ String ] Header value to be serialized.
51+
#
52+
# @return [ String ] Buffer with serialized value.
5253
def self.serialize(buffer, value)
5354
buffer.put_bytes(value.pack(HEADER_PACK))
5455
end
5556

5657
# Deserializes the header value from the IO stream
5758
#
58-
# @param io [IO] IO stream containing the message header.
59-
# @return [Array<Fixnum>] Array consisting of the deserialized
59+
# @param [ String ] buffer Buffer containing the message header.
60+
#
61+
# @return [ Array<Fixnum> ] Array consisting of the deserialized
6062
# length, request id, response id, and op code.
6163
def self.deserialize(buffer)
6264
buffer.get_bytes(16).unpack(HEADER_PACK)
@@ -70,9 +72,10 @@ module CString
7072

7173
# Serializes a C style string into the buffer
7274
#
73-
# @param buffer [String] Buffer to receive the serialized CString.
74-
# @param value [String] The string to be serialized.
75-
# @return [String] Buffer with serialized value.
75+
# @param buffer [ String ] Buffer to receive the serialized CString.
76+
# @param value [ String ] The string to be serialized.
77+
#
78+
# @return [ String ] Buffer with serialized value.
7679
def self.serialize(buffer, value)
7780
buffer.put_cstring(value)
7881
end
@@ -85,9 +88,10 @@ module Zero
8588

8689
# Serializes a 32-bit Zero into the buffer
8790
#
88-
# @param buffer [String] Buffer to receive the serialized Zero.
89-
# @param value [Fixnum] Ignored value.
90-
# @return [String] Buffer with serialized value.
91+
# @param buffer [ String ] Buffer to receive the serialized Zero.
92+
# @param value [ Fixnum ] Ignored value.
93+
#
94+
# @return [ String ] Buffer with serialized value.
9195
def self.serialize(buffer, value)
9296
buffer.put_int32(ZERO)
9397
end
@@ -100,17 +104,19 @@ module Int32
100104

101105
# Serializes a fixnum to a 4-byte 32-bit integer
102106
#
103-
# @param buffer [String] Buffer to receive the serialized Int32.
104-
# @param value [Fixnum] 32-bit integer to be serialized.
107+
# @param buffer [ String ] Buffer to receive the serialized Int32.
108+
# @param value [ Fixnum ] 32-bit integer to be serialized.
109+
#
105110
# @return [String] Buffer with serialized value.
106111
def self.serialize(buffer, value)
107112
buffer.put_int32(value)
108113
end
109114

110115
# Deserializes a 32-bit Fixnum from the IO stream
111116
#
112-
# @param io [IO] IO stream containing the 32-bit integer
113-
# @return [Fixnum] Deserialized Int32
117+
# @param [ String ] buffer Buffer containing the 32-bit integer
118+
#
119+
# @return [ Fixnum ] Deserialized Int32
114120
def self.deserialize(buffer)
115121
buffer.get_int32
116122
end
@@ -123,16 +129,18 @@ module Int64
123129

124130
# Serializes a fixnum to an 8-byte 64-bit integer
125131
#
126-
# @param buffer [String] Buffer to receive the serialized Int64.
127-
# @param value [Fixnum] 64-bit integer to be serialized.
128-
# @return [String] Buffer with serialized value.
132+
# @param buffer [ String ] Buffer to receive the serialized Int64.
133+
# @param value [ Fixnum ] 64-bit integer to be serialized.
134+
#
135+
# @return [ String ] Buffer with serialized value.
129136
def self.serialize(buffer, value)
130137
buffer.put_int64(value)
131138
end
132139

133140
# Deserializes a 64-bit Fixnum from the IO stream
134141
#
135-
# @param io [IO] IO stream containing the 64-bit integer.
142+
# @param [ String ] buffer Buffer containing the 64-bit integer.
143+
#
136144
# @return [Fixnum] Deserialized Int64.
137145
def self.deserialize(buffer)
138146
buffer.get_int64
@@ -146,9 +154,10 @@ module Document
146154

147155
# Serializes a document into the buffer
148156
#
149-
# @param buffer [String] Buffer to receive the BSON encoded document.
150-
# @param value [Hash] Document to serialize as BSON.
151-
# @return [String] Buffer with serialized value.
157+
# @param buffer [ String ] Buffer to receive the BSON encoded document.
158+
# @param value [ Hash ] Document to serialize as BSON.
159+
#
160+
# @return [ String ] Buffer with serialized value.
152161
def self.serialize(buffer, value, max_bson_size = nil)
153162
start_size = buffer.length
154163
value.to_bson(buffer)
@@ -159,8 +168,9 @@ def self.serialize(buffer, value, max_bson_size = nil)
159168

160169
# Deserializes a document from the IO stream
161170
#
162-
# @param io [IO] IO stream containing the BSON encoded document.
163-
# @return [Hash] The decoded BSON document.
171+
# @param [ String ] buffer Buffer containing the BSON encoded document.
172+
#
173+
# @return [ Hash ] The decoded BSON document.
164174
def self.deserialize(buffer)
165175
BSON::Document.from_bson(buffer)
166176
end

0 commit comments

Comments
 (0)