diff options
author | Xavier Noria <fxn@hashref.com> | 2010-01-03 00:00:11 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-01-03 00:00:11 +0100 |
commit | f95b12c3f3c7e80f1fbff18148c50036ef5c8dc7 (patch) | |
tree | 674de79fb3ac3b0601b5691cf436079afa4f8518 /railties | |
parent | 9c28fdaf8841ae017fed00c70a065a289193e309 (diff) | |
download | rails-f95b12c3f3c7e80f1fbff18148c50036ef5c8dc7.tar.gz rails-f95b12c3f3c7e80f1fbff18148c50036ef5c8dc7.tar.bz2 rails-f95b12c3f3c7e80f1fbff18148c50036ef5c8dc7.zip |
AS guide: documents the file where each method is defined to allow cherry-picking (rest)
Diffstat (limited to 'railties')
-rw-r--r-- | railties/guides/source/active_support_core_extensions.textile | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index e755eceb1d..7e13944afb 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -1620,6 +1620,8 @@ def assign_route_options(segments, defaults, requirements) end </ruby> +NOTE: Defined in +active_support/core_ext/regexp.rb+. + h3. Extensions to +Range+ h4. +to_s+ @@ -1636,6 +1638,8 @@ Active Support extends the method +Range#to_s+ so that it understands an optiona As the example depicts, the +:db+ format generates a +BETWEEN+ SQL clause. That is used by Active Record in its support for range values in conditions. +NOTE: Defined in +active_support/core_ext/range/conversions.rb+. + h4. +step+ Active Support extends the method +Range#step+ so that it can be invoked without a block: @@ -1646,6 +1650,8 @@ Active Support extends the method +Range#step+ so that it can be invoked without As the example shows, in that case the method returns and array with the corresponding elements. +NOTE: Defined in +active_support/core_ext/range/blockless_step.rb+. + h4. +include?+ The method +Range#include?+ says whether some value falls between the ends of a given instance: @@ -1665,6 +1671,8 @@ Active Support extends this method so that the argument may be another range in WARNING: The orginal +Range#include?+ is still the one aliased to +Range#===+. +NOTE: Defined in +active_support/core_ext/range/include_range.rb+. + h4. +overlaps?+ The method +Range#overlaps?+ says whether any two given ranges have non-void intersection: @@ -1675,6 +1683,8 @@ The method +Range#overlaps?+ says whether any two given ranges have non-void int (1..10).overlaps?(11..27) # => false </ruby> +NOTE: Defined in +active_support/core_ext/range/overlaps.rb+. + h3. Extensions to +Proc+ h4. +bind+ @@ -1719,6 +1729,8 @@ def handler_for_rescue(exception) end </ruby> +NOTE: Defined in +active_support/core_ext/proc.rb+. + h3. Extensions to +Date+ ... @@ -1761,6 +1773,8 @@ WARNING. Note you can't append with +atomic_write+. The auxiliary file is written in a standard directory for temporary files, but you can pass a directory of your choice as second argument. +NOTE: Defined in +active_support/core_ext/file/atomic.rb+. + h3. Extensions to +NameError+ Active Support adds +missing_name?+ to +NameError+, which tests whether the exception was raised because of the name passed as argument. @@ -1782,7 +1796,9 @@ rescue NameError => e raise e unless e.missing_name? "#{module_name}Helper" end </ruby> - + +NOTE: Defined in +active_support/core_ext/name_error.rb+. + h3. Extensions to +LoadError+ Rails hijacks +LoadError.new+ to return a +MissingSourceFile+ exception: @@ -1812,6 +1828,8 @@ rescue NameError => e end </ruby> +NOTE: Defined in +active_support/core_ext/load_error.rb+. + h3. Changelog "Lighthouse ticket":https://rails.lighthouseapp.com/projects/16213/tickets/67 |