Skip to content

Commit

Permalink
method comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jamis committed Oct 25, 2024
1 parent bf532b8 commit 93402c7
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/mongo/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,14 @@ def timeout_sec

private

# Attempts to parse the given list of addresses, using the provided options.
#
# @param [ String | Array<String> ] addresses the list of addresses
# @param [ Hash ] options the options that may drive how the list is
# processed.
#
# @return [ Hash<:uri, :addresses, :options> ] the results of processing the
# list of addresses.
def process_addresses(addresses, options)
if addresses.is_a?(String)
process_addresses_string(addresses, options)
Expand All @@ -1205,6 +1213,14 @@ def process_addresses(addresses, options)
end
end

# Attempts to parse the given list of addresses, using the provided options.
#
# @param [ String ] addresses the list of addresses
# @param [ Hash ] options the options that may drive how the list is
# processed.
#
# @return [ Hash<:uri, :addresses, :options> ] the results of processing the
# list of addresses.
def process_addresses_string(addresses, options)
{}.tap do |processed|
processed[:uri] = uri = URI.get(addresses, options)
Expand All @@ -1225,6 +1241,14 @@ def process_addresses_string(addresses, options)
end
end

# Attempts to parse the given list of addresses, using the provided options.
#
# @param [ Array<String> ] addresses the list of addresses
# @param [ Hash ] options the options that may drive how the list is
# processed.
#
# @return [ Hash<:uri, :addresses, :options> ] the results of processing the
# list of addresses.
def process_addresses_array(addresses, options)
{}.tap do |processed|
processed[:addresses] = addresses
Expand Down

0 comments on commit 93402c7

Please sign in to comment.