diff --git a/lib/mongoid/association/accessors.rb b/lib/mongoid/association/accessors.rb index 98fd7870d7..bb6841f311 100644 --- a/lib/mongoid/association/accessors.rb +++ b/lib/mongoid/association/accessors.rb @@ -251,7 +251,7 @@ def without_autobuild # @example Parse the args. # doc.parse_args(:name => "Joe") # - # @param [ Array ] args The arguments. + # @param [ Hash... ] *args The arguments. # # @return [ Array ] The attributes and options. def parse_args(*args) diff --git a/lib/mongoid/association/builders.rb b/lib/mongoid/association/builders.rb index 5ba9b1c62a..918b848ede 100644 --- a/lib/mongoid/association/builders.rb +++ b/lib/mongoid/association/builders.rb @@ -27,7 +27,7 @@ module Builders # @example Parse the args. # doc.parse_args(:name => "Joe") # - # @param [ Array ] args The arguments. + # @param [ Hash... ] *args The arguments. # # @return [ Array ] The attributes and options. def parse_args(*args) diff --git a/lib/mongoid/association/embedded/embeds_many/proxy.rb b/lib/mongoid/association/embedded/embeds_many/proxy.rb index 193d56edb9..77e0a39747 100644 --- a/lib/mongoid/association/embedded/embeds_many/proxy.rb +++ b/lib/mongoid/association/embedded/embeds_many/proxy.rb @@ -19,7 +19,7 @@ class Proxy < Association::Many # @example Push a document. # person.addresses.push(address) # - # @param [ Document | Array ] args Any number of documents. + # @param [ Document... ] *args Any number of documents. def <<(*args) docs = args.flatten return concat(docs) if docs.size > 1 @@ -117,7 +117,7 @@ def clear # @example Use #persisted? inside block to count persisted documents. # person.addresses.count { |a| a.persisted? && a.country == "FR" } # - # @param [ Object | Array ] args Args to delegate to the target. + # @param [ Object... ] *args Args to delegate to the target. # # @return [ Integer ] The total number of persisted embedded docs, as # flagged by the #persisted? method. @@ -235,7 +235,7 @@ def exists? # @example Finds the first matching document using a block. # person.addresses.find { |addr| addr.state == 'CA' } # - # @param [ Array ] args Various arguments. + # @param [ Object... ] *args Various arguments. # @param [ Proc ] block Optional block to pass. # # @return [ Document | Array | nil ] A document or matching documents. @@ -430,10 +430,10 @@ def integrate(document) # If the method exists on the array, use the default proxy behavior. # # @param [ Symbol | String ] name The name of the method. - # @param [ Array ] args The method args + # @param [ Object... ] *args The method args. # @param [ Proc ] block Optional block to pass. # - # @return [ Criteria, Object ] A Criteria or return value from the target. + # @return [ Criteria | Object ] A Criteria or return value from the target. ruby2_keywords def method_missing(name, *args, &block) return super if _target.respond_to?(name) klass.send(:with_scope, criteria) do diff --git a/lib/mongoid/association/proxy.rb b/lib/mongoid/association/proxy.rb index 383868de46..61e2bf5d07 100644 --- a/lib/mongoid/association/proxy.rb +++ b/lib/mongoid/association/proxy.rb @@ -118,7 +118,7 @@ def characterize_one(document) # to the target of the proxy. This can be overridden in special cases. # # @param [ String | Symbol ] name The name of the method. - # @param [ Array ] args The arguments passed to the method. + # @param [ Object... ] *args The arguments passed to the method. ruby2_keywords def method_missing(name, *args, &block) _target.send(name, *args, &block) end diff --git a/lib/mongoid/association/referenced/counter_cache.rb b/lib/mongoid/association/referenced/counter_cache.rb index 0d282b6c67..244381f2b8 100644 --- a/lib/mongoid/association/referenced/counter_cache.rb +++ b/lib/mongoid/association/referenced/counter_cache.rb @@ -13,7 +13,7 @@ module CounterCache # @example Reset the given counter cache # post.reset_counters(:comments) # - # @param [ Symbol | Array ] counters One or more counter caches to reset + # @param [ Symbol... ] *counters One or more counter caches to reset. def reset_counters(*counters) self.class.with(persistence_context) do |_class| _class.reset_counters(self, *counters) @@ -30,7 +30,7 @@ module ClassMethods # Post.reset_counters('50e0edd97c71c17ea9000001', :comments) # # @param [ String ] id The id of the object that will be reset. - # @param [ Symbol | Array ] counters One or more counter caches to reset + # @param [ Symbol... ] *counters One or more counter caches to reset. def reset_counters(id, *counters) document = id.is_a?(Document) ? id : find(id) counters.each do |name| diff --git a/lib/mongoid/association/referenced/has_and_belongs_to_many/proxy.rb b/lib/mongoid/association/referenced/has_and_belongs_to_many/proxy.rb index 80ffbaa134..150f1b3942 100644 --- a/lib/mongoid/association/referenced/has_and_belongs_to_many/proxy.rb +++ b/lib/mongoid/association/referenced/has_and_belongs_to_many/proxy.rb @@ -21,7 +21,7 @@ class Proxy < Referenced::HasMany::Proxy # @example Concat with other documents. # person.posts.concat([ post_one, post_two ]) # - # @param [ Document | Array ] args Any number of documents. + # @param [ Document... ] *args Any number of documents. # # @return [ Array ] The loaded docs. def <<(*args) diff --git a/lib/mongoid/association/referenced/has_many/enumerable.rb b/lib/mongoid/association/referenced/has_many/enumerable.rb index 859f08e3d5..668434efae 100644 --- a/lib/mongoid/association/referenced/has_many/enumerable.rb +++ b/lib/mongoid/association/referenced/has_many/enumerable.rb @@ -215,13 +215,13 @@ def empty? # completely depending on whether it is iterated to completion. # # This method can take a parameter and a block. The behavior with - # either the paramater or the block is delegated to the standard + # either the parameter or the block is delegated to the standard # library Enumerable module. # # Note that when Enumerable's any? method is invoked with both # a block and a pattern, it only uses the pattern. # - # @param [ Object ] condition The condition that documents + # @param [ Object... ] *args The condition that documents # must satisfy. See Enumerable documentation for details. # # @return [ true | false ] If the association has any documents. diff --git a/lib/mongoid/association/referenced/has_many/proxy.rb b/lib/mongoid/association/referenced/has_many/proxy.rb index a85d6da9d3..4f7b5b85ec 100644 --- a/lib/mongoid/association/referenced/has_many/proxy.rb +++ b/lib/mongoid/association/referenced/has_many/proxy.rb @@ -25,7 +25,7 @@ class Proxy < Association::Many # @example Concat with other documents. # person.posts.concat([ post_one, post_two ]) # - # @param [ Document | Array ] args Any number of documents. + # @param [ Document... ] *args Any number of documents. # # @return [ Array ] The loaded docs. def <<(*args) @@ -199,7 +199,7 @@ def exists? # @note This will keep matching documents in memory for iteration # later. # - # @param [ Object | Array ] *args The ids. + # @param [ [ Object | Array ]... ] *args The ids. # @param [ Proc ] block Optional block to pass. # # @return [ Document | Array | nil ] A document or matching documents. @@ -414,7 +414,7 @@ def cascade!(document) # If the method exists on the array, use the default proxy behavior. # # @param [ Symbol | String ] name The name of the method. - # @param [ Array ] args The method args + # @param [ Object... ] *args The method args # @param [ Proc ] block Optional block to pass. # # @return [ Criteria | Object ] A Criteria or return value from the target. diff --git a/lib/mongoid/association/reflections.rb b/lib/mongoid/association/reflections.rb index 98a42f2f5b..42e8374d24 100644 --- a/lib/mongoid/association/reflections.rb +++ b/lib/mongoid/association/reflections.rb @@ -25,7 +25,7 @@ def reflect_on_association(name) # @example Find multiple association metadata by macro. # person.reflect_on_all_associations(:embeds_many) # - # @param [ Array ] macros The association macros. + # @param [ Symbol... ] *macros The association macros. # # @return [ Array ] The matching association metadata. def reflect_on_all_association(*macros) @@ -51,7 +51,7 @@ def reflect_on_association(name) # @example Find multiple association metadata by macro. # Person.reflect_on_all_associations(:embeds_many) # - # @param [ Array ] macros The association macros. + # @param [ Symbol... ] *macros The association macros. # # @return [ Array ] The matching association metadata. def reflect_on_all_associations(*macros) diff --git a/lib/mongoid/attributes/dynamic.rb b/lib/mongoid/attributes/dynamic.rb index 89ddef5fc2..d803354100 100644 --- a/lib/mongoid/attributes/dynamic.rb +++ b/lib/mongoid/attributes/dynamic.rb @@ -115,7 +115,7 @@ def inspect_dynamic_fields # document.method_missing(:test) # # @param [ String | Symbol ] name The name of the method. - # @param [ Array ] args The arguments to the method. + # @param [ Object... ] *args The arguments to the method. # # @return [ Object ] The result of the method call. def method_missing(name, *args) diff --git a/lib/mongoid/attributes/nested.rb b/lib/mongoid/attributes/nested.rb index cf18bd9c50..1e70b31533 100644 --- a/lib/mongoid/attributes/nested.rb +++ b/lib/mongoid/attributes/nested.rb @@ -33,8 +33,8 @@ module ClassMethods # accepts_nested_attributes_for :addresses, :game, :posts # end # - # @param [ Array | Hash ] args A list of association names, followed - # by a hash of options. + # @param [ Symbol..., Hash ] *args A list of association names, followed + # by an optional hash of options. # # @option *args [ true | false ] :allow_destroy Can deletion occur? # @option *args [ Proc | Symbol ] :reject_if Block or symbol pointing diff --git a/lib/mongoid/attributes/readonly.rb b/lib/mongoid/attributes/readonly.rb index 3cf33b338f..30f94d9851 100644 --- a/lib/mongoid/attributes/readonly.rb +++ b/lib/mongoid/attributes/readonly.rb @@ -61,7 +61,7 @@ module ClassMethods # attr_readonly :name, :genre # end # - # @param [ Array ] names The names of the fields. + # @param [ Symbol... ] *names The names of the fields. def attr_readonly(*names) names.each do |name| readonly_attributes << database_field_name(name) diff --git a/lib/mongoid/contextual/atomic.rb b/lib/mongoid/contextual/atomic.rb index 3de0c3e368..32d897b40e 100644 --- a/lib/mongoid/contextual/atomic.rb +++ b/lib/mongoid/contextual/atomic.rb @@ -150,7 +150,7 @@ def set(sets) # @example Unset the field on the matches. # context.unset(:name) # - # @param [ String | Symbol | Array | Hash ] args + # @param [ [ String | Symbol | Array | Hash ]... ] *args # The name(s) of the field(s) to unset. # If a Hash is specified, its keys will be used irrespective of what # each key's value is, even if the value is nil or false. diff --git a/lib/mongoid/contextual/memory.rb b/lib/mongoid/contextual/memory.rb index 5026486137..0ce1fc3c8e 100644 --- a/lib/mongoid/contextual/memory.rb +++ b/lib/mongoid/contextual/memory.rb @@ -237,7 +237,7 @@ def limit(value) # @example Get the values in memory. # context.pluck(:name) # - # @param [ String | Symbol ] *fields Field(s) to pluck. + # @param [ [ String | Symbol ]... ] *fields Field(s) to pluck. # # @return [ Array | Array> ] The plucked values. def pluck(*fields) @@ -255,9 +255,9 @@ def pluck(*fields) # @example Get the values in memory. # context.pick(:name) # - # @param [ String | Symbol ] *fields Field(s) to pick. + # @param [ [ String | Symbol ]... ] *fields Field(s) to pick. # - # @return [ Object, Array ] The picked values. + # @return [ Object | Array ] The picked values. def pick(*fields) if doc = documents.first pluck_from_doc(doc, *fields) @@ -742,9 +742,9 @@ def retrieve_value_at_path(document, field_path) # Pluck the field values from the given document. # # @param [ Document ] doc The document to pluck from. - # @param [ String | Symbol ] *fields Field(s) to pluck. + # @param [ [ String | Symbol ]... ] *fields Field(s) to pluck. # - # @return [ Object, Array ] The plucked values. + # @return [ Object | Array ] The plucked values. def pluck_from_doc(doc, *fields) if fields.length == 1 retrieve_value_at_path(doc, fields.first) diff --git a/lib/mongoid/contextual/mongo.rb b/lib/mongoid/contextual/mongo.rb index 581c8f4f60..9cc9b1ad9e 100644 --- a/lib/mongoid/contextual/mongo.rb +++ b/lib/mongoid/contextual/mongo.rb @@ -321,7 +321,7 @@ def map_reduce(map, reduce) # @example Pluck a field. # context.pluck(:_id) # - # @param [ String | Symbol ] *fields Field(s) to pluck, + # @param [ [ String | Symbol ]... ] *fields Field(s) to pluck, # which may include nested fields using dot-notation. # # @return [ Array | Array> ] The plucked values. @@ -362,7 +362,7 @@ def pluck(*fields) # @example Pick a field. # context.pick(:_id) # - # @param [ String | Symbol ] *fields Field(s) to pick. + # @param [ [ String | Symbol ]... ] *fields Field(s) to pick. # # @return [ Object | Array ] The picked values. def pick(*fields) @@ -519,7 +519,7 @@ def sort(values = nil, &block) # @option opts [ Array ] :array_filters A set of filters specifying to which array elements # an update should apply. # - # @return [ nil, false ] False if no attributes were provided. + # @return [ nil | false ] False if no attributes were provided. def update(attributes = nil, opts = {}) update_documents(attributes, :update_one, opts) end @@ -535,7 +535,7 @@ def update(attributes = nil, opts = {}) # @option opts [ Array ] :array_filters A set of filters specifying to which array elements # an update should apply. # - # @return [ nil, false ] False if no attributes were provided. + # @return [ nil | false ] False if no attributes were provided. def update_all(attributes = nil, opts = {}) update_documents(attributes, :update_many, opts) end diff --git a/lib/mongoid/contextual/none.rb b/lib/mongoid/contextual/none.rb index 12f173df30..1d362e697e 100644 --- a/lib/mongoid/contextual/none.rb +++ b/lib/mongoid/contextual/none.rb @@ -88,7 +88,7 @@ def exists?; false; end # @example Get the values for null context. # context.pluck(:name) # - # @param [ String | Symbol ] *_fields Field(s) to pluck. + # @param [ [ String | Symbol ]... ] *_fields Field(s) to pluck. # # @return [ Array ] An empty Array. def pluck(*_fields) @@ -100,9 +100,9 @@ def pluck(*_fields) # @example Get the value for null context. # context.pick(:name) # - # @param [ String | Symbol ] *_fields Field or fields to pick. + # @param [ [ String | Symbol ]... ] *_fields Field(s) to pick. # - # @return [ nil ] Always reeturn nil. + # @return [ nil ] Always return nil. def pick(*_fields) nil end diff --git a/lib/mongoid/criteria.rb b/lib/mongoid/criteria.rb index e38ccbae60..51d0c10940 100644 --- a/lib/mongoid/criteria.rb +++ b/lib/mongoid/criteria.rb @@ -88,7 +88,7 @@ def ==(other) # @example Tries to find a document whose _id is the stringification of the provided Proc, typically failing. # enumerator = criteria.find(-> { "Default Band" }) # - # @param [ Object | Array ] *args The ids. + # @param [ [ Object | Array ]... ] *args The id(s). # @param [ Proc ] block Optional block to pass. # # @return [ Document | Array | nil ] A document or matching documents. @@ -284,7 +284,7 @@ def empty_and_chainable? # @example Limit the fields returned from the database. # Band.only(:name) # - # @param [ Array ] args The names of the fields. + # @param [ [ Symbol | Array ]... ] *args The field name(s). # # @return [ Criteria ] The cloned criteria. def only(*args) @@ -318,7 +318,7 @@ def read(value = nil) # @example Exclude fields returned from the database. # Band.without(:name) # - # @param [ Array ] args The names of the fields. + # @param [ Symbol... ] *args The field name(s). # # @return [ Criteria ] The cloned criteria. def without(*args) @@ -385,7 +385,8 @@ def type(types) # @example Add a javascript selection. # criteria.where("this.name == 'syd'") # - # @param [ String | Hash ] expression The javascript or standard selection. + # @param [ [ Hash | String ]... ] *args The standard selection + # or javascript string. # # @raise [ UnsupportedJavascript ] If provided a string and the criteria # is embedded. @@ -495,7 +496,7 @@ def initialize_copy(other) # criteria.method_missing(:name) # # @param [ Symbol ] name The method name. - # @param [ Array ] args The arguments. + # @param [ Object... ] *args The arguments. # # @return [ Object ] The result of the method call. ruby2_keywords def method_missing(name, *args, &block) diff --git a/lib/mongoid/criteria/findable.rb b/lib/mongoid/criteria/findable.rb index 4b354a1138..eaefb41831 100644 --- a/lib/mongoid/criteria/findable.rb +++ b/lib/mongoid/criteria/findable.rb @@ -21,7 +21,7 @@ def execute_or_raise(ids, multi) multi ? result : result.first end - # Find the matchind document(s) in the criteria for the provided ids. + # Find the matching document(s) in the criteria for the provided id(s). # # @note Each argument can be an individual id, an array of ids or # a nested array. Each array will be flattened. @@ -32,7 +32,7 @@ def execute_or_raise(ids, multi) # @example Find by multiple ids. # criteria.find([ BSON::ObjectId.new, BSON::ObjectId.new ]) # - # @param [ Object | Array ] *args The ids to search for. + # @param [ [ Object | Array ]... ] *args The id(s) to find. # # @return [ Document | Array ] The matching document(s). def find(*args) diff --git a/lib/mongoid/criteria/includable.rb b/lib/mongoid/criteria/includable.rb index 7e9d44d0f6..2fd421b42e 100644 --- a/lib/mongoid/criteria/includable.rb +++ b/lib/mongoid/criteria/includable.rb @@ -21,8 +21,8 @@ module Includable # @example Eager load the provided associations. # Person.includes(:posts, :game) # - # @param [ Array, Array ] relations The names of the associations to eager - # load. + # @param [ [ Symbol | Hash ]... ] *relations The names of the association(s) + # to eager load. # # @return [ Criteria ] The cloned criteria. def includes(*relations) @@ -70,7 +70,8 @@ def add_inclusion(association, parent = nil) # association originates. # @param [ String ] parent The name of the association above this one in # the inclusion tree, if it is a nested inclusion. - # @param relations_list The names of the associations to eager load. + # @param [ [ Symbol | Hash | Array ]... ] *relations_list + # The names of the association(s) to eager load. def extract_includes_list(_parent_class, parent, *relations_list) relations_list.flatten.each do |relation_object| if relation_object.is_a?(Hash) diff --git a/lib/mongoid/criteria/queryable/optional.rb b/lib/mongoid/criteria/queryable/optional.rb index 65fa32ddba..8477e8e154 100644 --- a/lib/mongoid/criteria/queryable/optional.rb +++ b/lib/mongoid/criteria/queryable/optional.rb @@ -17,7 +17,7 @@ module Optional # @example Add ascending sorting. # optional.ascending(:first_name, :last_name) # - # @param [ Array ] fields The fields to sort. + # @param [ Symbol... ] *fields The field(s) to sort. # # @return [ Optional ] The cloned optional. def ascending(*fields) @@ -45,7 +45,7 @@ def batch_size(value = nil) # @example Add descending sorting. # optional.descending(:first_name, :last_name) # - # @param [ Array ] fields The fields to sort. + # @param [ Symbol... ] *fields The field(s) to sort. # # @return [ Optional ] The cloned optional. def descending(*fields) @@ -123,7 +123,7 @@ def no_timeout # @example Limit the results to the provided fields. # optional.only(:name, :dob) # - # @param [ Array ] args The fields to return. + # @param [ Symbol... ] *args The field(s) to return. # # @return [ Optional ] The cloned optional. def only(*args) @@ -163,7 +163,7 @@ def only(*args) # @example Add sorting options via a string. # optional.order_by("name ASC, dob DESC") # - # @param [ Array | Hash | String ] spec The sorting specification. + # @param [ [ Array | Hash | String ]... ] *spec The sorting specification. # # @return [ Optional ] The cloned optional. def order_by(*spec) @@ -184,7 +184,7 @@ def order_by(*spec) # @example Replace the ordering. # optional.reorder(name: :asc) # - # @param [ Array | Hash | String ] spec The sorting specification. + # @param [ [ Array | Hash | String ]... ] *spec The sorting specification. # # @return [ Optional ] The cloned optional. def reorder(*spec) @@ -245,7 +245,7 @@ def snapshot # @example Limit the results to the fields not provided. # optional.without(:name, :dob) # - # @param [ Array ] args The fields to ignore. + # @param [ Symbol... ] *args The field(s) to ignore. # # @return [ Optional ] The cloned optional. def without(*args) @@ -331,7 +331,7 @@ def add_sort_option(options, field, direction) # @example Store the option. # optional.option({ skip: 10 }) # - # @param [ Array ] args The options. + # @param [ Object... ] *args The options. # # @return [ Queryable ] The cloned queryable. def option(*args) @@ -349,7 +349,7 @@ def option(*args) # @example Add multiple sort options. # optional.sort_with_list(:name, :dob, 1) # - # @param [ Array ] fields The field names. + # @param [ [ Symbol | String ]... ] *fields The field name(s). # @param [ Integer ] direction The sort direction. # # @return [ Optional ] The cloned optional. diff --git a/lib/mongoid/criteria/queryable/selectable.rb b/lib/mongoid/criteria/queryable/selectable.rb index b52c8e2bbf..86ea4689d3 100644 --- a/lib/mongoid/criteria/queryable/selectable.rb +++ b/lib/mongoid/criteria/queryable/selectable.rb @@ -31,7 +31,7 @@ module Selectable # @example Execute an $all in a where query. # selectable.where(:field.all => [ 1, 2 ]) # - # @param [ Hash ] criterion The key value pairs for $all matching. + # @param [ Hash... ] *criteria The key value pair(s) for $all matching. # # @return [ Selectable ] The cloned selectable. def all(*criteria) @@ -69,8 +69,9 @@ def all(*criteria) # @example Add the criterion. # selectable.and({ field: value }, { other: value }) # - # @param [ Array ] criteria Multiple key/value pair - # matches or Criteria objects that all must match to return results. + # @param [ [ Hash | Criteria | Array ]... ] *criteria + # Multiple key/value pair matches or Criteria objects that all must + # match to return results. # # @return [ Selectable ] The new selectable. def and(*criteria) @@ -516,8 +517,8 @@ def nin(condition) # @example Add the $nor selection. # selectable.nor(field: 1, field: 2) # - # @param [ Array ] criteria Multiple key/value pair - # matches or Criteria objects. + # @param [ [ Hash | Criteria | Array ]... ] *criteria + # Multiple key/value pair matches or Criteria objects. # # @return [ Selectable ] The new selectable. def nor(*criteria) @@ -545,7 +546,7 @@ def negating? # @example Execute a $not in a where query. # selectable.where(:field.not => /Bob/) # - # @param [ Array ] criteria Multiple key/value pair + # @param [ [ Hash | Criteria ]... ] *criteria The key/value pair # matches or Criteria objects to negate. # # @return [ Selectable ] The new selectable. @@ -605,7 +606,7 @@ def not(*criteria) # @example Same as previous example, also deprecated. # selectable.or([{field: 1}], [{field: 2}]) # - # @param [ Hash | Criteria | Array, ... ] criteria + # @param [ [ Hash | Criteria | Array ]... ] *criteria # Multiple key/value pair matches or Criteria objects, or arrays # thereof. Passing arrays is deprecated. # @@ -635,7 +636,7 @@ def or(*criteria) # @example Same as previous example, also deprecated. # selectable.any_of([{field: 1}], [{field: 2}]) # - # @param [ Hash | Criteria | Array, ... ] criteria + # @param [ [ Hash | Criteria | Array ]... ] *criteria # Multiple key/value pair matches or Criteria objects, or arrays # thereof. Passing arrays is deprecated. # @@ -774,7 +775,8 @@ def text_search(terms, opts = nil) # @example Add a javascript selection. # selectable.where("this.name == 'syd'") # - # @param [ String | Hash ] criterion The javascript or standard selection. + # @param [ [ Hash | String ]... ] *criterion The standard selection + # or javascript string. # # @return [ Selectable ] The cloned selectable. def where(*criteria) diff --git a/lib/mongoid/deprecable.rb b/lib/mongoid/deprecable.rb index 253aa1ffcd..e1c3c0ebd7 100644 --- a/lib/mongoid/deprecable.rb +++ b/lib/mongoid/deprecable.rb @@ -24,7 +24,7 @@ module Deprecable # #=> Mongoid.logger.warn("meow is deprecated and will be removed from Mongoid 8.0 (eat :catnip instead)") # # @param [ Module ] target_module The parent which contains the method. - # @param [ Symbol | Hash ] method_descriptors + # @param [ [ Symbol | Hash ]... ] *method_descriptors # The methods to deprecate, with optional replacement instructions. def deprecate(target_module, *method_descriptors) Mongoid::Deprecation.deprecate_methods(target_module, *method_descriptors) diff --git a/lib/mongoid/extensions/object.rb b/lib/mongoid/extensions/object.rb index ab9f69e138..a55c1e8de8 100644 --- a/lib/mongoid/extensions/object.rb +++ b/lib/mongoid/extensions/object.rb @@ -91,7 +91,7 @@ def blank_criteria? # object.do_or_do_not(:use, "The Force") # # @param [ String | Symbol ] name The method name. - # @param [ Array ] args The arguments. + # @param [ Object... ] *args The arguments. # # @return [ Object | nil ] The result of the method call or nil if the # method does not exist. @@ -190,7 +190,7 @@ def substitutable # object.you_must(:use, "The Force") # # @param [ String | Symbol ] name The method name. - # @param [ Array ] args The arguments. + # @param [ Object... ] *args The arguments. # # @return [ Object | nil ] The result of the method call or nil if the # method does not exist. Nil if the object is frozen. diff --git a/lib/mongoid/findable.rb b/lib/mongoid/findable.rb index bf6ad36653..edd9648461 100644 --- a/lib/mongoid/findable.rb +++ b/lib/mongoid/findable.rb @@ -149,7 +149,7 @@ def exists? # @note Each argument can be an individual id, an array of ids or # a nested array. Each array will be flattened. # - # @param [ Object | Array ] *args The _id value(s) to find. + # @param [ [ Object | Array ]... ] *args The id(s) to find. # # @return [ Document | Array | nil ] A document or matching documents. # diff --git a/lib/mongoid/interceptable.rb b/lib/mongoid/interceptable.rb index c7fc3404e8..ffeb1846d4 100644 --- a/lib/mongoid/interceptable.rb +++ b/lib/mongoid/interceptable.rb @@ -79,7 +79,7 @@ def in_callback_state?(kind) # @example Run only the after save callbacks. # model.run_after_callbacks(:save) # - # @param [ Array ] kinds The events that are occurring. + # @param [ Symbol... ] *kinds The events that are occurring. # # @return [ Object ] The result of the chain executing. def run_after_callbacks(*kinds) @@ -96,7 +96,7 @@ def run_after_callbacks(*kinds) # @example Run only the before save callbacks. # model.run_before_callbacks(:save, :create) # - # @param [ Array ] kinds The events that are occurring. + # @param [ Symbol... ] *kinds The events that are occurring. # # @return [ Object ] The result of the chain executing. def run_before_callbacks(*kinds) diff --git a/lib/mongoid/persistable/unsettable.rb b/lib/mongoid/persistable/unsettable.rb index fb1c35c0c9..92c797dcca 100644 --- a/lib/mongoid/persistable/unsettable.rb +++ b/lib/mongoid/persistable/unsettable.rb @@ -13,8 +13,8 @@ module Unsettable # @example Unset the values. # document.unset(:first_name, :last_name, :middle) # - # @param [ Array ] fields The names of the fields to - # unset. + # @param [ [ String | Symbol | Array]... ] *fields + # The names of the field(s) to unset. # # @return [ Document ] The document. def unset(*fields) diff --git a/lib/mongoid/validatable.rb b/lib/mongoid/validatable.rb index cd1a495113..5ba0f3546f 100644 --- a/lib/mongoid/validatable.rb +++ b/lib/mongoid/validatable.rb @@ -129,7 +129,8 @@ def validates_relation(association) # @example Validate with a specific validator. # validates_with MyValidator, on: :create # - # @param [ Class | Hash ] args The validator classes and options. + # @param [ ActiveModel::Validator..., Hash ] *args The validator classes + # and options hash. # # @note See ActiveModel::Validations::With for full options. This is # overridden to add autosave functionality when presence validation is diff --git a/lib/mongoid/validatable/macros.rb b/lib/mongoid/validatable/macros.rb index 7ef6feb34e..0a147ce1bb 100644 --- a/lib/mongoid/validatable/macros.rb +++ b/lib/mongoid/validatable/macros.rb @@ -18,7 +18,7 @@ module Macros # validates_associated :name, :addresses # end # - # @param [ Array ] args The arguments to pass to the validator. + # @param [ Object... ] *args The arguments to pass to the validator. def validates_associated(*args) validates_with(AssociatedValidator, _merge_attributes(args)) end @@ -35,7 +35,7 @@ def validates_associated(*args) # validates_uniqueness_of :title # end # - # @param [ Array ] args The arguments to pass to the validator. + # @param [ Object... ] *args The arguments to pass to the validator. def validates_uniqueness_of(*args) validates_with(UniquenessValidator, _merge_attributes(args)) end @@ -50,7 +50,7 @@ def validates_uniqueness_of(*args) # validates_format_of :title, with: /\A[a-z0-9 \-_]*\z/i # end # - # @param [ Array ] args The names of the fields to validate. + # @param [ Object... ] *args The names of the field(s) to validate. def validates_format_of(*args) validates_with(FormatValidator, _merge_attributes(args)) end @@ -65,7 +65,7 @@ def validates_format_of(*args) # validates_length_of :title, minimum: 100 # end # - # @param [ Array ] args The names of the fields to validate. + # @param [ Object... ] *args The names of the field(s) to validate. def validates_length_of(*args) validates_with(LengthValidator, _merge_attributes(args)) end @@ -80,7 +80,7 @@ def validates_length_of(*args) # validates_presence_of :title # end # - # @param [ Array ] args The names of the fields to validate. + # @param [ Object... ] *args The names of the field(s) to validate. def validates_presence_of(*args) validates_with(PresenceValidator, _merge_attributes(args)) end