diff options
author | Xavier Noria <fxn@hashref.com> | 2009-10-25 20:07:01 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2009-10-25 20:07:01 +0100 |
commit | e7b3ad535b7deefecd7d14ec3631757073ea3f39 (patch) | |
tree | 24a49e988fc281d061dd13f74fd85d30a4c5d5c5 /railties/guides | |
parent | 27993c5a215277765c5b845fe8dc75a48e7eb1db (diff) | |
download | rails-e7b3ad535b7deefecd7d14ec3631757073ea3f39.tar.gz rails-e7b3ad535b7deefecd7d14ec3631757073ea3f39.tar.bz2 rails-e7b3ad535b7deefecd7d14ec3631757073ea3f39.zip |
AS guide: documents the extension to Range#step
Diffstat (limited to 'railties/guides')
-rw-r--r-- | railties/guides/source/active_support_core_extensions.textile | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index c3eabe7376..e137eb436f 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -1625,7 +1625,15 @@ This method is also used in the routes code for building regexps. h3. Extensions to +Range+ -... +h4. +step+ + +Active Support extends the method +Range#step+ so that it can be invoked without a block: + +<ruby> +(1..10).step(2) # => [1, 3, 5, 7, 9] +</ruby> + +As the example shows, in that case the method returns and array with the corresponding elements. h3. Extensions to +Proc+ |