Skip to content
Browse files

docs updates

  • Loading branch information...
1 parent 31e3538 commit adf3aaddad7946c2b31a160a87e9e3cf5f0d536c @andrewplummer committed Sep 13, 2012
Showing with 12 additions and 12 deletions.
  1. +7 −7 lib/array.js
  2. +3 −3 lib/es5.js
  3. +2 −2 script/generate_docs.rb
View
14 lib/array.js
@@ -333,7 +333,7 @@
* @method find(<f>, [index] = 0, [loop] = false)
* @returns Mixed
* @short Returns the first element that matches <f>.
- * @extra <f> will match a string, number, array, object, or alternately test against a function or regex. Starts at [index], and will continue once from index = 0 if [loop] is true.
+ * @extra <f> will match a string, number, array, object, or alternately test against a function or regex. Starts at [index], and will continue once from index = 0 if [loop] is true. This method implements @array_matching.
* @example
*
+ [{a:1,b:2},{a:1,b:3},{a:1,b:4}].find(function(n) {
@@ -350,7 +350,7 @@
* @method findAll(<f>, [index] = 0, [loop] = false)
* @returns Array
* @short Returns all elements that match <f>.
- * @extra <f> will match a string, number, array, object, or alternately test against a function or regex. Starts at [index], and will continue once from index = 0 if [loop] is true.
+ * @extra <f> will match a string, number, array, object, or alternately test against a function or regex. Starts at [index], and will continue once from index = 0 if [loop] is true. This method implements @array_matching.
* @example
*
+ [{a:1,b:2},{a:1,b:3},{a:2,b:4}].findAll(function(n) {
@@ -374,7 +374,7 @@
* @method findIndex(<f>, [startIndex] = 0, [loop] = false)
* @returns Number
* @short Returns the index of the first element that matches <f> or -1 if not found.
- * @extra This method has a few notable differences to native %indexOf%. Although <f> will similarly match a primitive such as a string or number, it will also match deep objects and arrays that are not equal by reference (%===%). Additionally, if a function is passed it will be run as a matching function (similar to the behavior of %Array#filter%) rather than attempting to find that function itself by reference in the array. Finally, a regexp will be matched against elements in the array, presumed to be strings. Starts at [index], and will continue once from index = 0 if [loop] is true.
+ * @extra This method has a few notable differences to native %indexOf%. Although <f> will similarly match a primitive such as a string or number, it will also match deep objects and arrays that are not equal by reference (%===%). Additionally, if a function is passed it will be run as a matching function (similar to the behavior of %Array#filter%) rather than attempting to find that function itself by reference in the array. Starts at [index], and will continue once from index = 0 if [loop] is true. This method implements @array_matching.
* @example
*
+ [1,2,3,4].findIndex(3); -> 2
@@ -393,7 +393,7 @@
* @method count(<f>)
* @returns Number
* @short Counts all elements in the array that match <f>.
- * @extra <f> will match a string, number, array, object, or alternately test against a function or regex.
+ * @extra <f> will match a string, number, array, object, or alternately test against a function or regex. This method implements @array_matching.
* @example
*
* [1,2,3,1].count(1) -> 2
@@ -447,7 +447,7 @@
* @method exclude([f1], [f2], ...)
* @returns Array
* @short Removes any element in the array that matches [f1], [f2], etc.
- * @extra This is a non-destructive alias for %remove%. It will not change the original array.
+ * @extra This is a non-destructive alias for %remove%. It will not change the original array. This method implements @array_matching.
* @example
*
* [1,2,3].exclude(3) -> [1,2]
@@ -956,7 +956,7 @@
* @method remove([f1], [f2], ...)
* @returns Array
* @short Removes any element in the array that matches [f1], [f2], etc.
- * @extra Will match a string, number, array, object, or alternately test against a function or regex. This method will change the array! Use %exclude% for a non-destructive alias.
+ * @extra Will match a string, number, array, object, or alternately test against a function or regex. This method will change the array! Use %exclude% for a non-destructive alias. This method implements @array_matching.
* @example
*
* [1,2,3].remove(3) -> [1,2]
@@ -1037,7 +1037,7 @@
* @method none(<f>)
* @returns Boolean
* @short Returns true if none of the elements in the array match <f>.
- * @extra <f> will match a string, number, array, object, or alternately test against a function or regex.
+ * @extra <f> will match a string, number, array, object, or alternately test against a function or regex. This method implements @array_matching.
* @example
*
* [1,2,3].none(5) -> true
View
6 lib/es5.js
@@ -129,7 +129,7 @@
* @method every(<f>, [scope])
* @returns Boolean
* @short Returns true if all elements in the array match <f>.
- * @extra [scope] is the %this% object. In addition to providing this method for browsers that don't support it natively, this enhanced method also directly accepts strings, numbers, deep objects, and arrays for <f>. %all% is provided an alias.
+ * @extra [scope] is the %this% object. %all% is provided an alias. In addition to providing this method for browsers that don't support it natively, this method also implements @array_matching.
* @example
*
+ ['a','a','a'].every(function(n) {
@@ -154,7 +154,7 @@
* @method some(<f>, [scope])
* @returns Boolean
* @short Returns true if any element in the array matches <f>.
- * @extra [scope] is the %this% object. In addition to providing this method for browsers that don't support it natively, this enhanced method also directly accepts strings, numbers, deep objects, and arrays for <f>. %any% is provided as aliases.
+ * @extra [scope] is the %this% object. %any% is provided as an alias. In addition to providing this method for browsers that don't support it natively, this method also implements @array_matching.
* @example
*
+ ['a','b','c'].some(function(n) {
@@ -209,7 +209,7 @@
* @method filter(<f>, [scope])
* @returns Array
* @short Returns any elements in the array that match <f>.
- * @extra [scope] is the %this% object. In addition to providing this method for browsers that don't support it natively, this enhanced method also directly accepts strings, numbers, deep objects, and arrays for <f>.
+ * @extra [scope] is the %this% object. In addition to providing this method for browsers that don't support it natively, this method also implements @array_matching.
* @example
*
+ [1,2,3].filter(function(n) {
View
4 script/generate_docs.rb
@@ -201,8 +201,8 @@ def match_block(b, linenum, package)
@current_module = @packages[package][:modules][name.to_sym]
else
name, method = get_method(b)
- # Go 5 lines up so there's a little padding (Github doesn't do this)
- method[:line] = [0, linenum - 5].max
+ # Go a line up so there's a little padding (Github doesn't do this)
+ method[:line] = [0, linenum - 1].max
method[:returns] = get_property(:returns, b)
method[:short] = get_property(:short, b)
method[:extra] = get_property(:extra, b)

0 comments on commit adf3aad

Please sign in to comment.
Something went wrong with that request. Please try again.