From 9c28fdaf8841ae017fed00c70a065a289193e309 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 2 Jan 2010 23:49:55 +0100 Subject: Regexp#(un)optionalize are also gone --- .../source/active_support_core_extensions.textile | 25 ---------------------- 1 file changed, 25 deletions(-) (limited to 'railties') diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index d4931e0389..e755eceb1d 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -1620,31 +1620,6 @@ def assign_route_options(segments, defaults, requirements) end -h4. +optionalize(pattern)+ - -The class method +optionalize+ builds a regexp where the pattern argument is optional. That roughly means it gets a question mark appended with a non-capturing group if needed: - - -Regexp.optionalize('') # => '' -Regexp.optionalize('.') # => '.?' -Regexp.optionalize('...') # => '(?:...)?' - - -This method is also used by the routing system, it helps in building optional regexp segments. - -h4. +unoptionalize(pattern)+ - -The class method +unoptionalize+ is the inverse of +optionalize+ for optional regexps, and the identity for the rest: - - -Regexp.unoptionalize('') # => '' -Regexp.unoptionalize('.?') # => '.' -Regexp.unoptionalize('(?:...)?') # => '...' -Regexp.unoptionalize('\A\w+\z') # => '\A\w+\z' - - -This method is also used in the routes code for building regexps. - h3. Extensions to +Range+ h4. +to_s+ -- cgit v1.2.3